Not enough input arguments in while loop
15 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I have the code below that basically, when my start button is pretty it changes a variable that relates to the mode that should be running, and then calls the function to check the mode variable and in turn then runs the appropriate function. The function basically reads values from 4 sliders, converts the values into radians and then creates a serial link plot of them. However, i keep getting an error telling my i have insufficient input arguments when it gets to the
o = get(handles.omegaval,'Value');
code lines and i've tried adding various arguments that occured to me but none seemes to help, what do i need please?
function startbtn_Callback(hObject, eventdata, handles)
global moden
moden = 1;
set(handles.statusdisp,'String','Running');
readvals
function readvals (hObject, eventdata, handles)
global o
global a
global b
global g
global rado
global rada
global radb
global radg
global fourlink
global moden
while moden==1 do
o = get(handles.omegaval,'Value');
rado = (o*pi)/180;
a = get(handles.alphaval,'Value');
rada = (a*pi)/180;
b = get(handles.betaval,'Value');
radb = (b*pi)/180;
g = get(handles.gammaval,'Value');
radg = (g*pi)/180;
% Virtual Robot Setup %
% The robot is defined by Denavit-Hartenberg parameters
% theta d a alpha sigma
L(1) = Link([0 0 1 0 0]);
L(2) = Link([0 0 1 0 0]);
L(3) = Link([0 0 0.1 pi/2 0]);
L(4) = Link([0 0 1 0 0]);
fourlink = SerialLink(L, 'name', 'four link');
fourlink.plot([rado rada radb radg]);
end
0 Commenti
Risposte (1)
Walter Roberson
il 24 Giu 2012
I believe you have mis-understood the error. I believe the actual error is that you call readvals without passing any arguments. In startbtn_Callback you should be using
readvals([] [], handles)
When you call a function that takes arguments, the function call procedure will not take the arguments from the calling routine if you do not supply specific arguments.
Vedere anche
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!