how to label the axes when I want to plot the complex function in the case of( the phase of f(1/z) )?
조회 수: 4 (최근 30일)
I have received the following great answer for this question (how to plot the function f(1/z) in matlab where z is any complex numer)
% define the function f(z) in terms of its coefficients p:
% f(z) = z^2-2*z+1
p = [1 -2 1]; % polynomial coefficients p instead of anonymous function f
% evaluate f over all z in ([-1,1],[-1,1]):
f_of_z_result = polyval(p,z);
% evaluate f at 1/z:
f_of_1_over_z_result = polyval(p,1./z);
% plot the magnitude and phase of f(z) and f(1/z):
% (same as before)
title('phase of f(z)')
title('phase of f(1/z)')
My qestion now is how to label the real and imagenary axes and the axis representes phase of f(1/z)?
how can I use the same lable in (the phase of f(1/z)) and |f(1/z)|?
I maen the phase means the angle how lable its axese with numbers
I will appriciate any help.
SAI SRUJAN 2023년 10월 12일
Hi Aisha Mohamed,
I understand that you are facing an issue labeling the real and imaginary axes.
You can follow the below given example to resolve the issue.
x = linspace(-10, 10, 100);
y = linspace(-10, 10, 100);
[X, Y] = meshgrid(x, y);
Z = X.^2 + Y.^2;
surf(X, Y, Z);
You can use "xlabel" and "ylabel" MATLAB functions to label the real and imaginary axes.
I have provided links to relevant documentation which gives you further insight.