MATLAB Troubleshooting Error in MATLAB Plotting Function

AI Thread Summary
The discussion centers around an error encountered in a MATLAB project, specifically an "Illegal parameter-value pair" error when attempting to use the plot function. The user provides a snippet of their code, highlighting a function designed to plot data based on user choice. The problematic line identified is "plot(xset, yset, plotsymbol, xname, yname, title);". Key points include the incorrect usage of the plot function, as it does not accept the parameters in the way they are structured in the code. The user is advised to consult the MATLAB documentation for proper syntax and parameter requirements for the plot function. The conversation emphasizes the importance of adhering to function specifications to avoid such errors.
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
Back
Top