How do I create a phase plot?

I'm trying to plot two functions I have defined against each other but I am not getting the result I should be getting. The functions are
y=exp(-1/16*x)*(2*cos(sqrt(1023)/16*x)-382/sqrt(1023)*sin(sqrt(1023)/16*x))+12*sin(2*x)
and
y'=-1/16*exp(-1/16*x)*(2*cos(sqrt(1023)/16*x)-382/sqrt(1023)*sin(sqrt(1023)/16*x))+exp(-1/16*x)*(-sqrt(1023)/8*sin(sqrt(1023)/16*x)-382/16*cos(sqrt(1023)/16*x))+24*cos(2*x)
and I'm trying to create a plot of y' vs y.
I've tried the following code
f = @(x) -1/16*exp(-1/16*x)*(2*cos(sqrt(1023)/16*x)-382/sqrt(1023)*sin(sqrt(1023)/16*x))+exp(-1/16*x)*(-sqrt(1023)/8*sin(sqrt(1023)/16*x)-382/16*cos(sqrt(1023)/16*x))+24*cos(2*x);
g = @(x) exp(-1/16*x)*(2*cos(sqrt(1023)/16*x)-382/sqrt(1023)*sin(sqrt(1023)/16*x))+12*sin(2*x);
fplot(g,f)
and I get a plot that looks like this.
But according to the assignment the plot should look like this.

Respuestas (2)

KSSV
KSSV el 4 de Nov. de 2016
Editada: KSSV el 4 de Nov. de 2016

1 voto

You would have messed up with derivative of y. Check symbolic differentiation. You enter y, let matlab do derivative for you and then plot. Check symbolic calculations in matlab
Mahak Nischal
Mahak Nischal el 5 de Mayo de 2020

0 votos

need help in plotting beam phase profile of optical beam having phase a*exp(-phi*1i) where a is the amplitude?

Etiquetas

Preguntada:

el 4 de Nov. de 2016

Respondida:

el 5 de Mayo de 2020

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by