9
Crear una interfaz grafica del modelo que uno mismo desee en este caso fue de un convertidor de monedas internacionales INTERFAZ GRAFICA (EN MATLAB) PROGRAMACION AVANZADA Carlos Espinosa Herrera

interfazgrafica hecho en matlab

Embed Size (px)

DESCRIPTION

prograna diseña para hacer un convertidor de monedas diseñado en matlab y con su respectivo codigo

Citation preview

Page 1: interfazgrafica hecho en matlab

INTERFAZ GRAFICA (EN MATLAB)

PROGRAMACION AVANZADA

Page 2: interfazgrafica hecho en matlab
Page 3: interfazgrafica hecho en matlab

Introduccion

La interfaz gráfica de usuario, conocida también como GUI (del inglés graphical user interface), es un programa informático que actúa de interfaz de usuario, utilizando un conjunto de imágenes y objetos gráficos para representar la información y acciones disponibles en la interfaz. Su principal uso, consiste en proporcionar un entorno visual sencillo para permitir la comunicación con el sistema operativo de una máquina o computador.

Habitualmente las acciones se realizan mediante manipulación directa, para facilitar la interacción del usuario con la computadora. Surge como evolución de las interfaces de línea de comandos que se usaban para operar los primeros sistemas operativos y es pieza fundamental en un entorno gráfico. Como ejemplos de interfaz gráfica de usuario, cabe citar los entornos de escritorio Windows, el X-Window de GNU/Linux o el de Mac OS X, Aqua.

En el contexto del proceso de interacción persona-computadora, la interfaz gráfica de usuario es el artefacto tecnológico de un sistema interactivo que posibilita, a través del uso y la representación del lenguaje visual, una interacción amigable con un sistema informático.

Page 4: interfazgrafica hecho en matlab

Codigo de interfaz de programa de convertidor de monedas:

function varargout = bbbbbb(varargin)% BBBBBB M-file for bbbbbb.fig% BBBBBB, by itself, creates a new BBBBBB or raises the existing% singleton*.%% H = BBBBBB returns the handle to a new BBBBBB or the handle to% the existing singleton*.%% BBBBBB('CALLBACK',hObject,eventData,handles,...) calls the local% function named CALLBACK in BBBBBB.M with the given input arguments.%% BBBBBB('Property','Value',...) creates a new BBBBBB or raises the% existing singleton*. Starting from the left, property value pairs are% applied to the GUI before bbbbbb_OpeningFcn gets called. An% unrecognized property name or invalid value makes property application% stop. All inputs are passed to bbbbbb_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 bbbbbb % Last Modified by GUIDE v2.5 30-Aug-2015 21:10:23 % Begin initialization code - DO NOT EDITgui_Singleton = 1;gui_State = struct('gui_Name', mfilename, ... 'gui_Singleton', gui_Singleton, ... 'gui_OpeningFcn', @bbbbbb_OpeningFcn, ... 'gui_OutputFcn', @bbbbbb_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 % --- Executes just before bbbbbb is made visible.function bbbbbb_OpeningFcn(hObject, eventdata, handles, varargin)% This function has no output args, see OutputFcn.

Page 5: interfazgrafica hecho en matlab

% 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 bbbbbb (see VARARGIN) % Choose default command line output for bbbbbbhandles.output = hObject; % Update handles structureguidata(hObject, handles); % UIWAIT makes bbbbbb wait for user response (see UIRESUME)% uiwait(handles.figure1); % --- Outputs from this function are returned to the command line.function varargout = bbbbbb_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 structurevarargout{1} = handles.output; % --- Executes on button press in btnPesos.function btnPesos_Callback(hObject, eventdata, handles) s1=get(handles.num_1, 'String'); x1=str2double(s1); res=x1/16.75; str=num2str(res); set(handles.resultado1, 'String', str)% hObject handle to btnPesos (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) function num_1_Callback(hObject, eventdata, handles)% hObject handle to num_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 num_1 as text% str2double(get(hObject,'String')) returns contents of num_1 as a double % --- Executes during object creation, after setting all properties.function num_1_CreateFcn(hObject, eventdata, handles)% hObject handle to num_1 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called

Page 6: interfazgrafica hecho en matlab

% 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 btnDolares.function btnDolares_Callback(hObject, eventdata, handles) s2=get(handles.num_2, 'String'); x2=str2double(s2); go=x2*16.75; saty=num2str(go); set(handles.resultad2, 'String', saty)% hObject handle to btnDolares (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) function num_2_Callback(hObject, eventdata, handles)% hObject handle to num_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 num_2 as text% str2double(get(hObject,'String')) returns contents of num_2 as a double % --- Executes during object creation, after setting all properties.function num_2_CreateFcn(hObject, eventdata, handles)% hObject handle to num_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 euros.function euros_Callback(hObject, eventdata, handles) s3=get(handles.num_3, 'String'); x3=str2double(s3); li=x3/18.82; sol=num2str(li); set(handles.resultado4, 'String', sol)% hObject handle to euros (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)

Page 7: interfazgrafica hecho en matlab

% --- Executes on button press in btnEurotoPesos.function btnEurotoPesos_Callback(hObject, eventdata, handles) s4=get(handles.num_4, 'String'); x4=str2double(s4); ma=x4*18.82; nu=num2str(ma); set(handles.resultado5, 'String', nu)% hObject handle to btnEurotoPesos (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA) function num_3_Callback(hObject, eventdata, handles)% hObject handle to num_3 (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 num_3 as text% str2double(get(hObject,'String')) returns contents of num_3 as a double % --- Executes during object creation, after setting all properties.function num_3_CreateFcn(hObject, eventdata, handles)% hObject handle to num_3 (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 num_4_Callback(hObject, eventdata, handles)% hObject handle to num_4 (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 num_4 as text% str2double(get(hObject,'String')) returns contents of num_4 as a double % --- Executes during object creation, after setting all properties.function num_4_CreateFcn(hObject, eventdata, handles)% hObject handle to num_4 (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles empty - handles not created until after all CreateFcns called

Page 8: interfazgrafica hecho en matlab

% 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

Representacion grafica del respectivo programa