function varargout = module01(varargin)
% MODULE01 MATLAB code for module01.fig
% MODULE01, by itself, creates a new MODULE01 or raises the existing
% singleton*.
%
% H = MODULE01 returns the handle to a new MODULE01 or the handle to
% the existing singleton*.
%
% MODULE01('CALLBACK',hObject,eventData,handles,...) calls the local
% function named CALLBACK in MODULE01.M with the given input arguments.
%
% MODULE01('Property','Value',...) creates a new MODULE01 or raises the
% existing singleton*. Starting from the left, property value pairs are
% applied to the GUI before module01_OpeningFcn gets called. An
% unrecognized property name or invalid value makes property application
% stop. All inputs are passed to module01_OpeningFcn via varargin.
%
% *See GUI Options on GUIDE's Tools menu. Choose "GUI allows only one
% instance to run (singleton)".
%
% See also: GUIDE, GUIDATA, GUIHANDLES
% Edit the above text to modify the response to help module01
% Last Modified by GUIDE v2.5 08-Oct-2019 15:45:41
% Begin initialization code - DO NOT EDIT
gui_Singleton = 1;
gui_State = struct('gui_Name', mfilename, ...
'gui_Singleton', gui_Singleton, ...
'gui_OpeningFcn', @module01_OpeningFcn, ...
'gui_OutputFcn', @module01_OutputFcn, ...
'gui_LayoutFcn', [] , ...
'gui_Callback', []);
if nargin && ischar(varargin{1})
gui_State.gui_Callback = str2func(varargin{1});
end
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
clear;
% --- Executes just before module01 is made visible.
function module01_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to module01 (see VARARGIN)
% Choose default command line output for module01
handles.output = hObject;
% Update handles structure
guidata(hObject, handles);
% UIWAIT makes module01 wait for user response (see UIRESUME)
% uiwait(handles.figure1);
% --- Outputs from this function are returned to the command line.
function varargout = module01_OutputFcn(hObject, eventdata, handles)
% varargout cell array for returning output args (see VARARGOUT);
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Get default command line output from handles structure
varargout{1} = handles.output;
function edit2_Callback(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit2 as text
% str2double(get(hObject,'String')) returns contents of edit2 as a double
% --- Executes during object creation, after setting all properties.
function edit2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in pushbutton1.
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
function edit_shujulujing_1_Callback(hObject, eventdata, handles)
% hObject handle to edit_shujulujing_1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit_shujulujing_1 as text
% str2double(get(hObject,'String')) returns contents of edit_shujulujing_1 as a double
% --- Executes during object creation, after setting all properties.
function edit_shujulujing_1_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_shujulujing_1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function edit_shujulujing_2_Callback(hObject, eventdata, handles)
% hObject handle to edit_shujulujing_2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'String') returns contents of edit_shujulujing_2 as text
% str2double(get(hObject,'String')) returns contents of edit_shujulujing_2 as a double
% --- Executes during object creation, after setting all properties.
function edit_shujulujing_2_CreateFcn(hObject, eventdata, handles)
% hObject handle to edit_shujulujing_2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles empty - handles not created until after all CreateFcns called
% Hint: edit controls usually have a white background on Windows.
% See ISPC and COMPUTER.
if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
% --- Executes on button press in Add_Data1.
function Add_Data1_Callback(hObject, eventdata, handles) %加载可再生能源数据;
% hObject handle to Add_Data1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%[filename1,pathname,FILTERINDEX]=uigetfile({'*.*';'*.mat';'*.xls';'*.xlsx';'*.csv'},'选择数据文件');
% set(0,'currentfigure',AddDataParmeterInformation);%数据加载前,请先设置所加载数据的基本参数信息!
% evalin('base','clear all');
set(handles.CDF_1,'Enable','off');set(handles.CDF_2,'Enable','off');
% set(handles.rongliangxuqiufenxi,'Enable','off');set(handles.churongpeibifenxi,'Enable','off');
% set(handles.Num1,'String','0');set(handles.Num2,'String','0');
global Data_dis; %可再生能源数据
caiyangjiange1=str2double(get(handles.caiyangjiange1,'String'));
zhuangjirongliang=str2double(get(handles.Cap1,'String'));
if (~isnan(caiyangjiange1))&&(caiyangjiange1>0)&&(~isnan(zhuangjirongliang))&&(zhuangjirongliang>0)
Data_dis=0;
[filename1,pathname,FILTERINDEX]=uigetfile({'*.mat';'*.*'},'选择数据文件');
if(FILTERINDEX==0)
errordlg('你没有加载数据,请加载数据!','错误提示');
Data_dis=0;
set(handles.edit_shujulujing_1,'String','');
set(handles.Num1,'String','0');
set(handles.NumberDay,'String','0');
return;
end
str_filename=[pathname,filename1];
set(handles.edit_shujulujing_1,'String',str_filename);%路径显示
str=dir('pathname\filename');
if FILTERINDEX==1
Data_dis=load(str_filename);
Data_dis=cell2mat(struct2cell(Data_dis));
n1=length(Data_dis);
str=num2str(n1);
set(handles.Num1,'String',str);
a=60*24/caiyangjiange1; b=fix(length(Data_dis)/a);
str=num2str(b);
set(handles.NumberDay,'String',str);
stri=cell(b+1,1);
for i=1:b
stri{i}=int2str(i);
end
stri{b+1}='All';
set(handles.Dayxuanze,'String',stri);
else
评论0