- #1
Dustinsfl
- 2,281
- 5
How would I plot a 3D phase and magnitude plot for the function \(z^{1/3}\) in Matlab?
For the magnitude plot and phase, I used
Are these correct?
Code:
n = 3; % number of roots
m = 18; % grid number
r = (0:m)'/m; % radius vector
theta = pi*(-n*m:n*m)/m; % angle vector
z = r*exp(1i*theta); % z = re^(itheta)
x = real(z); % real z
y = imag(z); % imaginary z
w = r.^(1/n)*exp(1i*theta/n); % w = z^(1/3)
u = real(w); % real w
v = imag(w); % imaginary w
Code:
surf(x, y, abs(w)) % mag
surf(x, y, angle(w)) % phase
Last edited: