MATLAB plot function rejects string arguments as parameters

Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
1 reply · 3K views
Spectre32
Messages
136
Reaction score
0
Ok I'm workin on this porject and I just got this error:

? Error using ==> plot
Illegal parameter-value pair.

Error in ==> plotfunction at 21
plot(xset, yset,plotsymbol ,xname,yname,title);


When I click on it to take me where the problem is, this is what I have there:

% plot data according to type chosen by user

if choice == 1
plot(xset,yset,plotsymbol,xname,yname,title);
elseif choice == 2
semilogy(xset,yset,plotsymbol,xname,yname,title);
else choice == 3
loglog(xset,yset,plotsymbol,xname,yname,title);
end



It brings me too line 21
Code:
"plot(xset, yset,plotsymbol ,xname,yname,title);"
as being the problem.

This is what my function looks likes:

Code:
function [] = plotfunction(xset,yset,plotsymbol,choice,xname,yname,title);


Any help would be appericated
 
Physics news on Phys.org