You are on page 1of 2

function tres_graficos_OpeningFcn(hObject, eventdata, handles, varargin)

yr=[1988:1994];
sle=[8 12 20 22 18 24 27];
axes(handles.axes1);
bar(yr,sle,'g')
xlabel('Año');
ylabel('Ventas en millones');
axes(handles.axes2);
stem(yr,sle,'r')
xlabel('Año');
ylabel('Ventas en millones');
axes(handles.axes3);
pie(sle)
handles.output = hObject;

function varargout = tres_graficos_OutputFcn(hObject, eventdata, handles)


varargout{1} = handles.output;
function popupmenu1_Callback(hObject, eventdata, handles)
global a
a=get(hObject,'Value');
switch a
case 1
axes(handles.axes1);
case 2
axes(handles.axes2);
case 3
axes(handles.axes3);
end

function popupmenu1_CreateFcn(hObject, eventdata, handles)


if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end
function pushbutton1_Callback(hObject, eventdata, handles)
global x y
prompt={'X','Y'};
title= ('DATOS');
dims=[1 75]
definput={'1','1'};
ans=inputdlg(prompt,title,dims,definput);
x=str2num(ans{1});
assignin('base','x',x);
y=str2num(ans{2});
assignin('base','y',y);

function pushbutton3_Callback(hObject, eventdata, handles)


global color
color= uisetcolor
set(handles.text3,'Backgroundcolor',color)
function popupmenu2_Callback(hObject, eventdata, handles)
global a x y color
b=get(hObject,'Value');
switch b
case 1
bar(x,y)
xlabel('Año');
ylabel('Ventas en millones');

case 2
stem(x,y);
xlabel('Año');
ylabel('Ventas en millones');
case 3
pie(x);
xlabel('Año');
ylabel('Ventas en millones');
end

function popupmenu2_CreateFcn(hObject, eventdata, handles)


if ispc && isequal(get(hObject,'BackgroundColor'),
get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function text3_CreateFcn(hObject, eventdata, handles)

 function calculadora_michael_OpeningFcn(hObject, eventdata,


handles, varargin)
global x y
handles.variable1=x;
handles.variable2=y;
handles.output = hObject;
guidata(hObject, handles);
function pushbutton12_Callback(hObject, eventdata, handles)
global x y;
x=0;
y='';
set(handles.text2,'String',y);
function pushbutton15_Callback(hObject, eventdata, handles)
global x y
x=x+1;
y(x)='+';
set(handles.text2,'String',y);

function pushbutton18_Callback(hObject, eventdata, handles)


global x y;
if y(x-1) == '/' && y(x)== '0'
set(handles.text2,'String','Math ERROR');
errordlg('No es posible realizar una división con el denominador
cero. Ingrese nuevamente un número y asegúrese de ingresar un valor
diferente de cero','Math ERROR');
x=x-1;
else
s=str2num(y);
y=num2str(s);
x=length(num2str(y));
set(handles.text2,'String',y);
end

function text2_CreateFcn(hObject, eventdata, handles)

You might also like