How to plot real and complex parts of a function in 3d?
11 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
i have an assignment that reads as such:


My task is to plot 3 sub plots showing G in terms of real, complex, and the magnitude of the transfer function. I assume by magnitude, they mean the original plot with real and complex combined, if not then I will have to rework my equation. I have found a way, I think to graph the 3d plot by using resources in previously asked questions. My code looks as such:
clear
[x,y] = meshgrid(-10: 0.5: 10);
s = x + 1i*y;
G = abs(((s+2) ./ ((s.^2) + 6.*s + 18)));
figure;
surf(x,y,G)
Which results in an image as such:

My question is how do I split this graph into 2 subplots where I am showing the real and the complex independently? I don't see that type of question either in the Help section or in previously posted questions...
0 Kommentare
Antworten (2)
Shyamali Abeysooriya
am 28 Nov. 2021
clear
[x,y] = meshgrid(-10: 0.5: 10);
s = x + 1i*y;
G = abs(((s+2) ./ ((s.^2) + 6.*s + 18)));
figure;
surf(x,y,G)
0 Kommentare
KSSV
am 29 Aug. 2017
You can seperate the real part and complex part using real and imag.
real_part = real(s) ;
imag_part = imag(s) ;
0 Kommentare
Siehe auch
Kategorien
Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!