Struggling to plot a complex function using the mesh command.
Show older comments
Hi,
I need help with making a complex mesh of a function. The function is simply sin(a+a*pi/2) but a is a complex number.
I want to make the domain from -360i to 360i in the complex axis and -360 to 360 in the real axis. With a step of 1 in each. Meaing I will have 721x721 resutls to plot.
upper = 360;
dx = 1;
x = -upper:dx:upper;
z = zeros(length(x),length(x));
y = zeros(1, length(x));
for i = 1:length(x)
for count = 1:length(x)
z(i,count) = complex(x(i),x(count));
end
end
y = sind(z+z.*pi()./2);
Above is the code I used to get the results for the function and stored it in y. x is every point along the real axis, and z is everypoint on the real-imagainary plane.
Now I'm not sure how I should plot this using the mesh function. Of course there is the first problem that plotting this would require 4 dmentions; but I'm happy to take the absolute value/real value/ complex value to limit the answer to 3d. But, I'm not sure how to polt any of these graphs, and ideal plot them all at the same time.
mesh(x , x*j ? , ?)
Thank you in advanced.
2 Comments
KSSV
on 23 Jul 2020
The function has a, and a values are defined......how you can take values from -2*pi to 2*pi. ?
Wojciech Kalinowski
on 23 Jul 2020
Accepted Answer
More Answers (0)
Categories
Find more on Startup and Shutdown 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!