Carluladora Cientifica Matlab
Carluladora Cientifica Matlab
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State, varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
% --- Outputs from this function are returned to the command line.
function varargout = Calculadora_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)
%
------------------------------------------------------------------
--
function cambio_Callback(hObject, eventdata, handles)
% hObject handle to cambio (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles structure with handles and user data (see GUIDATA)
%
------------------------------------------------------------------
--
function Untitled_1_Callback(hObject, eventdata, handles)
% hObject handle to Untitled_1 (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles structure with handles and user data (see GUIDATA)
%
------------------------------------------------------------------
--
function nomal_Callback(hObject, eventdata, handles)
% hObject handle to nomal (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles structure with handles and user data (see GUIDATA)
%
------------------------------------------------------------------
--
function cientfk_Callback(hObject, eventdata, handles)
% hObject handle to cientfk (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles structure with handles and user data (see GUIDATA)
%
------------------------------------------------------------------
--
function Cientifica_Callback(hObject, eventdata, handles)
% hObject handle to Cientifica (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles structure with handles and user data (see GUIDATA)
%
------------------------------------------------------------------
--
function DEReINT_Callback(hObject, eventdata, handles)
% hObject handle to DEReINT (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles structure with handles and user data (see GUIDATA)
% --- Executes on button press in Graf.
function Graf_Callback(hObject, eventdata, handles)
set(handles.text5,'String','')
ecuacion=get(handles.edit2,'String');
if isempty(ecuacion)==1,
set(handles.text5,'String','ERROR: No existe ninguna Formula')
return;
end;
ini=get(handles.edit3,'String');
fin=get(handles.edit4,'String');
h=get(handles.edit5,'String');
if isempty(ini)==1 && isempty(fin)==1 && isempty(h)==1,
ini=-10;
fin=10;
h=.01;
elseif isempty(ini)==0 && isempty(fin)==0 && isempty(h)==1,
if isempty(str2num(ini))==1 || isempty(str2num(fin))==1,
set(handles.text5,'String','ERROR: Valores de entrada
incorrectos')
return;
else
ini=str2double(ini);
fin=str2double(fin);
end;
if fin<ini,
set(handles.text5,'String','ERROR: El intervalo Final es
menor que el Intervalo Inicial')
return;
end;
h=(fin-ini)/1000;
elseif isempty(ini)==0 && isempty(fin)==0 && isempty(h)==0,
if isempty(str2num(ini))==1 || isempty(str2num(fin))==1 ||
isempty(str2num(h))==1,
set(handles.text5,'String','ERROR: Valores de entrada
Incorrectos')
return;
else
ini=str2double(ini);
fin=str2double(fin);
h=str2double(h);
end;
if fin<ini,
set(handles.text5,'String','ERROR: El intervalo Final es
menor que el Intervalo Inicial')
return;
end;
else
set(handles.text5,'String','ERROR: No existen valores de
entrada')
return;
end;
set(handles.edit3,'String',num2str(ini))
set(handles.edit4,'String',num2str(fin))
set(handles.edit5,'String',num2str(h))
x=ini:h:fin;
formula=inline(ecuacion);
n=length(x);
y=[];
for i=1:n,
y=[y formula(x(i))];
end;
axes(handles.axes7)
plot(x,y,'b')
grid on
xlabel('x')
ylabel('f(x)')
tabla(:,1)=x;
tabla(:,2)=y;
set(handles.uitable1,'Data',tabla);
if valor3==1
syms z
f=diff(f,z);
set(handles.edit2,'String',char(f));
end
%
------------------------------------------------------------------
--
function Matriz_Callback(hObject, eventdata, handles)
% hObject handle to Matriz (see GCBO)
% eventdata reserved - to be defined in a future version of
MATLAB
% handles structure with handles and user data (see GUIDATA)