too many input arguements error

조회 수: 2 (최근 30일)
William
William 2012년 6월 19일
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

답변 (1개)

Walter Roberson
Walter Roberson 2012년 6월 19일
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

카테고리

Help CenterFile Exchange에서 Code Execution에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by