Taller UI Con Matlab
Taller UI Con Matlab
Taller UI Con Matlab
Algoritmo
function varargout = RobotDiosa(varargin)
% ROBOTDIOSA MATLAB code for RobotDiosa.fig
% ROBOTDIOSA, by itself, creates a new ROBOTDIOSA
or raises the existing
% singleton*.
%
% H = ROBOTDIOSA returns the handle to a new
ROBOTDIOSA or the handle to
% the existing singleton*.
%
%
ROBOTDIOSA('CALLBACK',hObject,eventData,handles,...)
calls the local
% function named CALLBACK in ROBOTDIOSA.M with the
given input arguments.
%
% ROBOTDIOSA('Property','Value',...) creates a new
ROBOTDIOSA or raises the
% existing singleton*. Starting from the left,
property value pairs are
% applied to the GUI before RobotDiosa_OpeningFcn
gets called. An
% unrecognized property name or invalid value makes
property application
% stop. All inputs are passed to
RobotDiosa_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
if nargout
[varargout{1:nargout}] = gui_mainfcn(gui_State,
varargin{:});
else
gui_mainfcn(gui_State, varargin{:});
end
% End initialization code - DO NOT EDIT
function actualizar(hObject,eventdata,hfigure)
handles = guidata(hfigure); %linea desde ejemplo del
timer matlab
global n vel pos x y
%set(handles.text5,'string',strcat(num2str(toc,'%.1f')))
if n==1
set(handles.pushbutton1,'BackgroundColor','red')
set(handles.pushbutton1,'string','DETENER')
y(length(y)+1)=sin(pos)*vel+y(length(y));
x(length(x)+1)=cos(pos)*vel+x(length(x));
plot(handles.axes1,x,y,'*')
xlim(handles.axes1,[-1000 1000])
ylim(handles.axes1,[-1000 1000])
end
if n==2
set(handles.pushbutton1,'BackgroundColor','green')
set(handles.pushbutton1,'string','AVANZAR')
end
Gráficas
1. Robot inicia en una posición 0,0.