Unexpected operator for 'plotinequality'

  • Thread starter Thread starter ENDLESSYOU
  • Start date Start date
  • Tags Tags
    Operator
AI Thread Summary
The discussion centers on troubleshooting an error encountered when attempting to plot inequalities in MATLAB using the command plot(plot::Inequality(x^2 + y^2 < 1,x = -1.5..1.5, y = -1.5..1.5). The error message indicates an "Unexpected MATLAB operator," which is linked to the use of the '::' operator that was introduced in MATLAB version 2012b. Users confirm their MATLAB versions, with some on R2012b and others on older versions like R2011b, which do not support the required syntax. A suggested workaround involves using a MuPAD notebook with the command evalin(symengine, 'plot(plot::Inequality(x^2 + y^2 < 1,x = -1.5..1.5, y = -1.5..1.
ENDLESSYOU
Messages
29
Reaction score
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
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 '::'.
 
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
 
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.
 

Similar threads

Back
Top