how can i change the horizontal and vertical axis of an ezplot of a symbolic equation?
for example an implicit equation of lambda & beta. how MATLAB can understand what i want to be for x axis and what for y axis??
how can i change the horizontal and vertical axis of an ezplot of a symbolic equation?
for example an implicit equation of lambda & beta. how MATLAB can understand what i want to be for x axis and what for y axis??
You can use a function handle, and flip the order (x,y) vs (y,x):
figure(1), ezplot( @(x,y) sqrt(x.^2 + y.^2 - 1), [-2 2 -4 4] )
figure(2), ezplot( @(y,x) sqrt(x.^2 + y.^2 - 1), [-2 2 -4 4] )
Let me give you another easier solution. Just plot your your function the usual way, then use:
view([90 -90])
to rotate the axes (x-axis becomes y-axis and vice versa)
but i have a main expression of beta not a function and is so long. because it is made of some parameters that they themselves are made of some expressions too. how can i convert it to a function? i mean, can i use the name of the main expression to make a function?
for example if: n1,n2,m,a=const. u=sqrt(n2-beta^2); w=sqrt(beta^2-n1); a=tan(u)/w+tanh(w)/u; b=tanh(u)/w; f=(a+b)*cos(a*u+m*pi)+a-b*sin(a*u+m*pi); is the main expression.