필터 지우기
필터 지우기

I plot these two functions by Matlab but the phase of the both of them look likes strange and I think the plot of the phase is wrong in both of them

조회 수: 4 (최근 30일)
I plot these two functions by Matlab but the phase of the both of them look likes strange and I think the plot of the phase is wrong in both of them can you help me to correct these figures
the first function is f(z) = (0.10 + 0.3i) + (0.4243 + 0.0017i)*z + (0.9 − 0.001i)*z^2 and its plot is
the phase of this function look likes rwrong because for example at Z_R equales zero Z_I increace sharply and I do not know the correct value of Z_I ?
The second function is
f(z) = (0.10 − 0.3i)*z^(−1) + (0.2121 − 0.0008i)*z^(−2) + (0.9 + 0.001i)*z(−3).
and its figure is
Also here the phase of the function looks like wrong because for examble at Z_R equales zero Z_I increace sharply and I do not know the correct value of Z_I ?
I appreciate any help

답변 (1개)

SAI SRUJAN
SAI SRUJAN 2024년 1월 31일
Hi Aisha,
I understand that you are facing an issue while plotting the phase of a complex function.
When plotting the phase of a complex function, it's important to ensure that the phase is continuous over the region of interest. MATLAB's 'angle' function returns values between '-pi' and 'pi', resulting in discontinuities when the phase crosses these boundaries.
The 'unwrap' function in MATLAB is used to correct the phase angles to produce smoother phase plots. This function is particularly useful when you want to visualize the phase as a continuous function over a range of input values.
Please refer to the following example to proceed further,
[X, Y] = meshgrid(linspace(-1, 1, 100), linspace(-1, 1, 100));
Z = X + 1i*Y;
fz = (0.10 + 0.3i) + (0.4243 + 0.0017i)*Z + (0.9 - 0.001i)*Z.^2;
phase_fz = unwrap(angle(fz), [], 2);
figure;
surf(X, Y, phase_fz, 'EdgeColor', 'none');
colorbar;
By unwrapping the phase, the plot should show a smooth transition of phase angles, without the artificial jumps caused by the branch cuts of the 'angle' function. Please refer to the following documentation for a better understanding of the 'unwrap' MATLAB function.
I hope this helps!

카테고리

Help CenterFile Exchange에서 Exploration and Visualization에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by