mercredi 9 avril 2014

Am trying to plot the magnitude of a complex function in MATLAB


Vote count:

0




This is my code so far:



sigma = -8:0.1:0;
omega = -10:0.1:10;

[x,y] = meshgrid(sigma, omega);

s = x + y*j;

zz = (5^2)./(s.^2 + 2*0.4*5.*s + 5^2);
xx = real(s);
yy = imag(s);
surf(xx,yy,zz);


I am getting the error that I can not use a complex variable in the surf function. I know the issue is in the zz variable, but I do not know how to find the magnitude of a complex function.



asked 35 secs ago






Aucun commentaire:

Enregistrer un commentaire