Troubleshooting Error in MATLAB Plotting Function

In summary, there is an error in the plotfunction that is being used in a project. The error is caused by incorrect usage of the plot function and is located on line 21 of the code. The plotfunction should be checked and corrected according to the MATLAB documentation for the plot function.
  • #1
Spectre32
136
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

Related to Troubleshooting Error in MATLAB Plotting Function

1. What is a "Troubleshooting Error in MATLAB Plotting Function"?

A "Troubleshooting Error in MATLAB Plotting Function" is an error message that appears when trying to plot data in MATLAB. It indicates that there is a problem with the code or data being used for the plot and needs to be addressed before the plot can be successfully created.

2. Why am I getting a "Troubleshooting Error in MATLAB Plotting Function"?

There are several reasons why you may be getting this error. It could be due to a mistake in the code used for plotting, incorrect data format, missing or corrupted files, or compatibility issues between different versions of MATLAB. It is important to carefully review your code and data to identify the specific cause of the error.

3. How can I fix a "Troubleshooting Error in MATLAB Plotting Function"?

The first step to fixing this error is to carefully review your code and data to identify any mistakes or inconsistencies. You can also try restarting MATLAB, checking for updates, and making sure all necessary files are present. If the error persists, you may need to consult MATLAB documentation or seek help from a more experienced user.

4. Can I prevent "Troubleshooting Error in MATLAB Plotting Function" from occurring?

While it is not always possible to prevent this error from occurring, there are some steps you can take to minimize the chances. These include double-checking your code before running it, using proper data formats, and keeping your MATLAB software up to date. It is also helpful to regularly save your work in case of any unexpected errors.

5. Is there a specific error code associated with "Troubleshooting Error in MATLAB Plotting Function"?

There is no specific error code associated with this error as it can vary depending on the specific issue. However, some common error messages that may indicate a "Troubleshooting Error in MATLAB Plotting Function" include "Undefined function or variable", "Invalid data type", or "File not found". It is important to carefully read the error message to determine the cause of the error.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
12
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
7K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
4K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
4K
Back
Top