Function: 'Gui - Name' 'Gui - Singleton' 'Gui - Openingfcn' 'Gui - Outputfcn' 'Gui - Layoutfcn' 'Gui - Callback'
Function: 'Gui - Name' 'Gui - Singleton' 'Gui - Openingfcn' 'Gui - Outputfcn' 'Gui - Layoutfcn' 'Gui - Callback'
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 = graficadort_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)
ecuacion=get(handles.txt_ecuacion,'string');
xi=str2double(get(handles.txt_xi,'string')); %str2double es para
tranformar a numero
xd=str2double(get(handles.txt_xd,'string'));
paso=str2double(get(handles.txt_paso,'string'));
x=xi:paso:xd; %es como un for
y=eval(ecuacion);
%plot(x,y);
ecuacion2='x.*x-10'; %funcion cuadrada
y2=eval(ecuacion2); %me va a evaluar la funcion
y2=0.1*y2;
plot(handles.axes1,x,y,'b',x,y2,'r'); %se dibuja 2 funciones en la misma
axes
grid (handles.axes1,'on'); %sacan las cuadriculas en donde yo quiero
axes1