Graphing exponential function with imaginary term
显示 更早的评论
I am trying to plot a function where my amplitude is dependant on varaiable say z. and the phase is depentant on theta which is varying form -pi/2 to pi/2.
I get error as
empty double row vector
I saw some other plots. I don't understnd why it doens't work for me.
clear all;
clc;
close all;
pi = 3.1415;
theta = linspace(-pi/2,pi/2,0.01)
z = linspace(-pi/2,pi/2,0.01)
g2 = 5;
g3 = 0.5;
sigma0 = 0.05;
B = -(3*g2*sigma0-8*g3*sigma0)/((2*g2*sigma0))
D = (3*g2*sigma0-8*g3*sigma0)^2/((6*g2))
sigma0 = 0.05;
sigma = sigma0*(1-(B./(1+D.*z.^2)))
psi = sqrt(sigma).*exp(1i.*theta)
figure()
plot3(theta,real(psi),imag(psi))
% plot3(z,theta,imag(psi))
% hold on
grid on
xlabel('\psi', 'Rotation',-30)
ylabel('Real Axis', 'Rotation',10)
zlabel('Imag Axis')
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Polar Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!