Unexpected operator for 'plotinequality'

  • Thread starter Thread starter ENDLESSYOU
  • Start date Start date
  • Tags Tags
    Operator
Click For Summary
SUMMARY

The discussion centers on the error "Unexpected MATLAB operator" encountered when attempting to plot inequalities using the command plot(plot::Inequality(x^2 + y^2 < 1,x = -1.5..1.5, y = -1.5..1.5)) in MATLAB. This operator was introduced in MATLAB version R2012b, which means users with earlier versions, such as R2011b, will face compatibility issues. A 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.5))'). Users are advised to upgrade to at least R2012b or utilize MuPAD for successful execution.

PREREQUISITES
  • Familiarity with MATLAB R2012b or later
  • Understanding of plotting inequalities in MATLAB
  • Knowledge of MuPAD notebooks and their usage
  • Basic syntax for MATLAB commands and functions
NEXT STEPS
  • Research how to create and use MuPAD notebooks in MATLAB
  • Learn about the differences between MATLAB versions, focusing on R2012b features
  • Explore alternative plotting techniques for inequalities in MATLAB
  • Investigate the use of evalin function in MATLAB for executing commands in the symbolic engine
USEFUL FOR

MATLAB users, especially those working with symbolic computations, educators teaching mathematical concepts, and developers needing to visualize inequalities in their projects.

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

  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 11 ·
Replies
11
Views
5K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 12 ·
Replies
12
Views
3K