Troubleshooting Error in MATLAB Plotting Function

Click For Summary
SUMMARY

The forum discussion addresses an error encountered in a MATLAB plotting function, specifically an "Illegal parameter-value pair" error when using the plot function. The issue arises from incorrect usage of the plot function parameters in the user-defined function 'plotfunction'. The correct syntax requires the parameters to be formatted properly according to MATLAB's documentation. Users are advised to consult the official MATLAB documentation for the plot function to resolve such issues.

PREREQUISITES
  • Familiarity with MATLAB programming language
  • Understanding of MATLAB plotting functions
  • Knowledge of function parameter passing in MATLAB
  • Basic debugging skills in MATLAB
NEXT STEPS
  • Review the MATLAB documentation for the plot function
  • Learn about MATLAB function parameter validation techniques
  • Explore error handling in MATLAB to improve debugging
  • Investigate alternative plotting functions like semilogy and loglog in MATLAB
USEFUL FOR

This discussion is beneficial for MATLAB users, particularly those involved in data visualization, software developers working with MATLAB, and anyone troubleshooting plotting errors in their MATLAB scripts.

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

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 9 ·
Replies
9
Views
5K
  • · Replies 12 ·
Replies
12
Views
3K
  • · Replies 2 ·
Replies
2
Views
8K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 6 ·
Replies
6
Views
6K
  • · Replies 3 ·
Replies
3
Views
2K
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K