too many input arguements error
3 views (last 30 days)
Show older comments
hi, I'm trying to create a piece of code where a created timer runs and updates a polar plot, on my GUI, with values from a slider constantly. Once I've got this working i'm hoping to be able to extrapolate without too much difficulty, Right now i keep getting an error message telling me I have too many input arguements and I'm new to matlab and have defined inputs and outputs where I felt they were required but obviously there are some missing/too many somewhere. help please! The relevant code is as follows :
function testrobotarm_OpeningFcn(hObject, eventdata, handles, varargin)
handles.output = hObject;
guidata(hObject, handles);
global t
global rho
global rado
t = timer('TimerFcn',plotting(rho,rado, hObject, eventdata, handles),'ExecutionMode','fixedRate','BusyMode','Queue','Period',0.5);
start(t)
set(handles.status,'String','Running');
function [radO] = plotting ( hObject, eventdata, handles)
global rado
radO=rado;
polar(radO,rho,'-*m')
**************** value 'rado' is defined elsewhere in the code and its value is obtained using
rado=get(handles.slider1,'Value');
and i know this part works fine as it displays fine in an edit box I've learnt what i know of MATLAB through googling code and altering it so apologies if i'm missing something really stupid
Thanks in advance
0 Comments
Answers (1)
Walter Roberson
on 19 Jun 2012
t = timer('TimerFcn', @plotting, 'ExecutionMode', 'fixedRate', 'BusyMode', 'Queue', 'Period', 0.5);
and change
function [radO] = plotting ( hObject, eventdata, handles)
global rado
to
function plotting( hObject, eventdata )
global rado rho
0 Comments
See Also
Categories
Find more on Code Execution in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!