function varargout = historicossim(varargin) % HISTORICOSSIM M-file for historicossim.fig % HISTORICOSSIM, by itself, creates a new HISTORICOSSIM or raises the existing % singleton*. % % H = HISTORICOSSIM returns the handle to a new HISTORICOSSIM or the handle to % the existing singleton*. % % HISTORICOSSIM('CALLBACK',hObject,eventData,handles,...) calls the local % function named CALLBACK in HISTORICOSSIM.M with the given input arguments. % % HISTORICOSSIM('Property','Value',...) creates a new HISTORICOSSIM or raises the % existing singleton*. Starting from the left, property value pairs are % applied to the GUI before historicossim_OpeningFunction gets called. An % unrecognized property name or invalid value makes property application % stop. All inputs are passed to historicossim_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 historicossim % Last Modified by GUIDE v2.5 29-Nov-2004 23:51:41 % Begin initialization code - DO NOT EDIT gui_Singleton = 1; gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @historicossim_OpeningFcn, ... 'gui_OutputFcn', @historicossim_OutputFcn, ... 'gui_LayoutFcn', [] , ... 'gui_Callback', []); if nargin & isstr(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 % --- Executes just before historicossim is made visible. function historicossim_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 historicossim (see VARARGIN) % Choose default command line output for historicossim handles.output = hObject; % Update handles structure guidata(hObject, handles); % UIWAIT makes historicossim wait for user response (see UIRESUME) % uiwait(handles.figure1); %Sets the list box directory to the current directory, %if no directory is specified. Changes the current directory, if a directory is specified. set(handles.axes6,'visible','off'); set(handles.axes7,'visible','off'); set(handles.text6,'visible','off'); for i=16:26 set(eval(strcat('handles.text',num2str(i))),'visible','off'); end if nargin == 3, initial_dir = pwd; elseif nargin == 4 & exist(varargin{1},'dir') initial_dir = varargin{1}; else errordlg('Input argument must be a valid directory','Input Argument Error!') return end % Populate the listbox load_listbox(initial_dir,handles) % --- Outputs from this function are returned to the command line. function varargout = historicossim_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; % --- Executes during object creation, after setting all properties. function listbox1_CreateFcn(hObject, eventdata, handles) % hObject handle to listbox1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles empty - handles not created until after all CreateFcns called % Hint: listbox controls usually have a white background on Windows. % See ISPC and COMPUTER. if ispc set(hObject,'BackgroundColor','white'); else set(hObject,'BackgroundColor',get(0,'defaultUicontrolBackgroundColor')); end % --- Executes on selection change in listbox1. function listbox1_Callback(hObject, eventdata, handles) % hObject handle to listbox1 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) % Hints: contents = get(hObject,'String') returns listbox1 contents as cell array % contents{get(hObject,'Value')} returns selected item from listbox1 if strcmp(get(handles.figure1,'SelectionType'),'open') % If double click index_selected = get(handles.listbox1,'Value'); file_list = get(handles.listbox1,'String'); filename = file_list{index_selected}; % Item selected in list box if handles.is_dir(handles.sorted_index(index_selected)) % If directory cd (filename) load_listbox(pwd,handles) % Load list box with new directory else [path,name,ext,ver] = fileparts(filename); switch ext case '.mat' dib=open(filename); case '.MAT' dib=open(filename); otherwise errordlg(lasterr,'File Type Error','modal') end end end function load_listbox(dir_path, handles) %This example creates a subfunction to load items into the list box. %This subfunction accepts the path to a directory and the handles %structure as input arguments. %It performs these steps: %Change to the specified directory so the GUI can navigate up and down %the tree as required. %Use the dir command to get a list of files in the specified directory %and to determine which name is a directory and which is a file. dir %returns a structure (dir_struct) with two fields, %name and isdir, which contain this information. %Sort the file and directory names (sortrows) and save the sorted names %and other information in the handles structure so this information %can be passed to other functions. %The name structure field is passed to sortrows as a cell array, %which is transposed to get one file name per row. %The isdir field and the sorted index values, %sorted_index, are saved as vectors in the handles structure. %Call guidata to save the handles structure. %Set the list box String property to display the file and directory %names and set the Value property to 1. %This is necessary to ensure Value never exceeds the number of items in String, %since MATLAB updates the Value property only when a selection occurs and not when %the contents of String changes. %Displays the current directory in the text box by setting its String property %to the output of the pwd command. %The load_listbox function is called by the opening function of the GUI M-file %as well as by the list box callback. cd (dir_path) dir_struct = dir(dir_path); [sorted_names,sorted_index] = sortrows({dir_struct.name}'); handles.file_names = sorted_names; handles.is_dir = [dir_struct.isdir]; handles.sorted_index = [sorted_index]; guidata(handles.figure1,handles) set(handles.listbox1,'String',handles.file_names,... 'Value',1) set(handles.text2,'String',pwd) % --- Executes on button press in pushbutton23. function pushbutton23_Callback(hObject, eventdata, handles) % hObject handle to pushbutton23 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) plot([0],[0],'parent',handles.axes6); plot([0],[0],'parent',handles.axes7); set(handles.text1,'visible','on'); set(handles.listbox1,'visible','on'); set(handles.text2,'visible','on'); set(handles.text3,'visible','on'); set(handles.axes6,'visible','off'); set(handles.axes7,'visible','off'); set(handles.pushbutton24,'visible','on'); set(handles.pushbutton23,'visible','off'); set(handles.frame1,'visible','on'); set(handles.pushbutton25,'visible','on'); set(handles.text6,'visible','off'); for i=16:26 set(eval(strcat('handles.text',num2str(i))),'visible','off'); end % --- Executes on button press in pushbutton24. function pushbutton24_Callback(hObject, dib, handles) % hObject handle to pushbutton24 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) index_selected = get(handles.listbox1,'Value'); file_list = get(handles.listbox1,'String'); filename = file_list{index_selected}; % Item selected in list box [path,name,ext,ver] = fileparts(filename); switch ext case '.mat' case '.MAT' otherwise errordlg(lasterr,'File Type Error','modal') return; end set(handles.text6,'visible','on'); for i=16:26 set(eval(strcat('handles.text',num2str(i))),'visible','on'); end set(handles.text1,'visible','off'); set(handles.listbox1,'visible','off'); set(handles.text2,'visible','off'); set(handles.text3,'visible','off'); set(handles.pushbutton24,'visible','off'); set(handles.pushbutton23,'visible','on'); set(handles.frame1,'visible','off'); set(handles.pushbutton25,'visible','off'); dib=open(filename); set(handles.axes6,'visible','on'); plot(dib.Rad.time,dib.Rad.signals.values,'r','parent',handles.axes6); set(handles.axes7,'visible','on'); plot(dib.Tref.time,dib.Tref.signals.values,'k',dib.Tsc.time,dib.Tsc.signals.values,'b',dib.Tec.time,dib.Tec.signals.values,'m',dib.Tac.time,dib.Tac.signals.values,'y',dib.VM1.time,dib.VM1.signals.values,'c','parent',handles.axes7); %'b',dib.Tec.time,dib.Tec.signals.values,'m',dib.Tac.time,dib.signals.values,'y',dib.VM1.time,dib.VM1.signals.values,'b','parent',handles.axes7); xlabel('Tiempo(Seg)'); %xlabel('Tiempo(Seg)',handles.axes7); % --- Executes on button press in pushbutton25. function pushbutton25_Callback(hObject, eventdata, handles) % hObject handle to pushbutton25 (see GCBO) % eventdata reserved - to be defined in a future version of MATLAB % handles structure with handles and user data (see GUIDATA) close('historicossim'); run('solarsim'); e-REdING. Biblioteca de la Escuela Superior de Ingenieros de Sevilla.


DISEÑO E IMPLEMENTACIÓN DE CONTROLADORES PARA UNA INSTALACIÓN SOLAR TÉRMICA

: Guillén Ruiz, Félix
: Ingeniería Industrial
Contenido del proyecto: