Graphing exponential function with imaginary term
Show older comments
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')
Accepted Answer
More Answers (0)
Categories
Find more on Polar Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!