This might be a simple question to ask, but the idea for me is to understand plotting of equations (not functions..but expressions with (in)equality sign) in 3 cases:
- one variable
- two variables
- more than two variables
I've studied several posts, did several experiments but dont get a full picture. So please help.
In summary, my questions are to know simple ways for quick plotting in these cases:
- Question1: How do I plot equations in one variable with conditions?e.g. how to plot y=x where x is even
- Question2: How do I plot equation of a circle (x^2+y@ = 4) without using ezplot?
- Question3: How do I plot equations in multiple variables like (x^2+y^2+z^2 == 100) or (x^2+y^2+z^2 <= 100)?
- Its possible to plot function of one variables using fplotfplot(@(x) (x^2), [-20,10])
But not possible to:
- plot function in 2 or more variables using fplot (as per documentation)
- plot equalitiesfplot(@(x) x/2==0, [-20,20]);
(The statement also looks weird to me and ofcoure has no result)
- plot inequalities (y = x if x>0)fplot(@(x) x>=0, [-20,20]);
(Again it also looks weird to me and has no result)
Say,I want to plot an equation of a circle x^2 + y^2 = 4 It is possible if I use ezplot which supports even two variable equations. But Matlab says it is deprecated.
syms x y
However, it can not scale to multi variables and it can not plot inequality
Is there a simple and intuitive way or do i need to go to surf and mesh?
More than two variables
Here also, how to plot equations?
x=[10,10]; y=[-10,10]; [X,Y]=meshgrid(x,y); Z=(X.^2+Y.^2)<=2
this obviously will not work. Then how?