Unexpected operator for 'plotinequality'

  • Thread starter ENDLESSYOU
  • Start date
  • Tags
    Operator
In summary, the conversation discusses an issue with plotting an inequality command in MATLAB and mentions a possible solution by using a MUPAD notebook. However, the solution may not work for older versions of MATLAB that do not have the necessary extensions.
  • #1
ENDLESSYOU
29
0
When I try to operate this command
plot(plot::Inequality(x^2 + y^2 < 1,x = -1.5..1.5, y = -1.5..1.5))
It failed, and displayed
Error: Unexpected MATLAB operator.
How can I fix it?
 
Physics news on Phys.org
  • #3
jedishrfu said:
What version of MATLAB do you have? According to MATLAB docs that operator was added in MATLAB 2012b:

http://www.mathworks.com/help/symbolic/mupad_ref/plot-inequality.html

anyway here's an alternative scheme:

http://stackoverflow.com/questions/11345838/how-to-plot-inequalities

My version is R2012b, and I just copied the codes form the examples on the webpage. But it failed. It seems like the problem is about '::'.
 
  • #4
ENDLESSYOU said:
My version is R2012b, and I just copied the codes form the examples on the webpage. But it failed. It seems like the problem is about '::'.

The reference below said that it only works in a MUPAD notebook and to try this:

evalin(symengine, 'plot(plot::Inequality(x^2 + y^2 < 1,x = -1.5..1.5, y = -1.5..1.5))')

http://www.mathworks.com/matlabcentral/answers/14607

Doesn't work for me as I don't have these extensions and I am at MATLAB 2011b
 
  • #5
jedishrfu said:
The reference below said that it only works in a MUPAD notebook and to try this:

evalin(symengine, 'plot(plot::Inequality(x^2 + y^2 < 1,x = -1.5..1.5, y = -1.5..1.5))')

http://www.mathworks.com/matlabcentral/answers/14607

Doesn't work for me as I don't have these extensions and I am at MATLAB 2011b

Thanks. I can use 'mphandle = mupad' to create a MuPAD notebook, and input the syntax.
 

What does "Unexpected operator for 'plotinequality'" mean?

"Unexpected operator for 'plotinequality'" is an error message that occurs when there is an error in the code of a program or script that involves plotting inequalities. Specifically, it means that the program has encountered an unexpected mathematical operator when trying to plot an inequality.

Why am I getting the error message "Unexpected operator for 'plotinequality'"?

You are getting this error message because there is a mistake in the code for plotting inequalities. This could be due to a typo, missing or incorrect mathematical operators, or other syntax errors.

How can I fix the "Unexpected operator for 'plotinequality'" error?

To fix this error, you will need to carefully review the code for plotting inequalities and check for any mistakes. This may involve double-checking the use of mathematical operators, making sure they are in the correct order, and ensuring that all necessary variables and functions are properly defined.

Can I prevent the "Unexpected operator for 'plotinequality'" error from occurring?

Yes, you can prevent this error by writing careful and accurate code for plotting inequalities. This may involve using proper syntax, checking for typos, and testing the code thoroughly before running it.

Is the "Unexpected operator for 'plotinequality'" error common?

While this error may occur from time to time, it is not a particularly common error. It is more likely to occur if there are mistakes in the code or if the code is not written carefully.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
9
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
3K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
11
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
4
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
3
Views
2K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
1K
  • Precalculus Mathematics Homework Help
Replies
6
Views
672
Back
Top