Can anyone plot these function by using Matlab (R2023a version) or (R2023b version) and show me if there is any differenc between my figures and the Matlab (R2023a version)

13 views (last 30 days)
I ploted these two functions in the extended complexplain $\mathbb{C} \cup \{ \infty \}$
\begin{align*}
f_k(z)=(0.10+0.3i) + \sqrt{2}(0.3+0.0012i) z +(0.9-0.001i)z^{2}
\end{align*}
\begin{align*}
f_b(z)=(0.10-0.3i) z^{-1} + \sqrt{\frac{1}{2}}(0.3-0.0012i) z^{-2} +(0.9+0.001i)z^{-3}
\end{align*}
by using Matlab (R2018a version), I have the following figure,
Where I used the following code
t=0
f0=[0.10 + 0.3i ; 0.3 + 0.0012i ; 0.9 - 0.001i ];
H = [2 -3i 0;3i 2 0;0 0 1];
p=[ ( 0.9000 - 0.0010i) (0.4243 + 0.0017i) (0.1000 + 0.3000i) ]; %t=0
p1=[(0.9000 + 0.0010i) (0.2121 - 0.0008i) (0.1000 - 0.3000i) (0)] ; %t=0
f(:,:) = expm(i*H*t)*f0
re_z = -6.005:.01:6.005;
im_z= -6.005:.01:6.005;
[re_z,im_z] = meshgrid(re_z,im_z);
z = re_z + 1i*im_z;
f_of_z_result = polyval(p,z);
f_of_1_over_z_result = polyval(p1,1./z);
figure();
subplot(2,2,1)
surf(re_z,im_z,abs(f_of_z_result),'EdgeColor','none')
colorbar
title('|f_k(z)|')
xlabel('Z_R')
ylabel('Z_I')
zlim([0 15])
caxis([-6 6])
grid on
subplot(2,2,2)
surf(re_z,im_z,cos(angle(f_of_z_result)),'EdgeColor','none')
colorbar
title('cos(phase of f_k(z))')
xlabel('Z_R')
ylabel('Z_I')
zlim([-5 5])
caxis([-1 1])
subplot(2,2,3)
surf(re_z,im_z,abs(f_of_1_over_z_result),'EdgeColor','none')
colorbar
title('|f_b(1/z)|')
xlabel('Z_R')
ylabel('Z_I')
zlim([0 2])
caxis([-0.15 0.15])
subplot(2,2,4)
surf(re_z,im_z, cos(angle(f_of_1_over_z_result)),'EdgeColor','none'
colorbar
title(('phase of f(1/z)'))
title(('cos(phase of f_b(1/z))'))
xlabel('Z_R')
ylabel('Z_I')
caxis([-1 1])
zlim([-1 1])
grid on
My question is: can anyone plot these function by using Matlab (R2023a version) or (R2023b version) and show me if there is any difference between my figures and the Matlab (R2023a version) or (R2023b version) figures?
Many thanks
I appreciate any help

Answers (2)

Richard Burnside
Richard Burnside on 19 Jun 2023
I get this on 2023a:
  2 Comments
Aisha Mohamed
Aisha Mohamed on 19 Jun 2023
Thanks Richard, I think you have got it . could you please press Tools in this figure and choose rotate 3D and go to x-y view to check that you have the same figure?
Also, can I ask how can I get Matlab 2023a, to use it, please?
Mny thanks
Richard Burnside
Richard Burnside on 19 Jun 2023
Edited: Richard Burnside on 19 Jun 2023
x-y view rotated...
The company where I work purchased a 2023a license for me recently. You could maybe use a trial version if you just have this one task to do.
The surf command in your 4th subplot needs a right paren at the end of the line.

Sign in to comment.


Steven Lord
Steven Lord on 19 Jun 2023
Looking at the two pictures posted in this thread, I'm guessing the original poster had turned hold on (or had changed the default axes properties to the same effect) before plotting the data. If you do that surf will not override the view (changing it from 2-D to 3-D.)
figure
hold on % axes will stay in 2-D view
surf(peaks)
figure
axes; % not held
surf(peaks)
You could keep the axes held before plotting if after plotting you called view to explicitly change the view to 3-D. hold on just prevents automatic modification of axes properties; if you explicitly change those properties MATLAB will respect the changes.
figure
ax = axes;
hold on
[az, el] = view % 2-D default
az = 0
el = 90
surf(peaks)
view(3)
[az2, el2] = view
az2 = -37.5000
el2 = 30
  1 Comment
Aisha Mohamed
Aisha Mohamed on 19 Jun 2023
Hi Dear
Which function did you plot it, please? and why this different from the Richard's plotting (specially both of you used Matlab 2023a and plotting in 3D)?
I appreciate your effort.

Sign in to comment.

Categories

Find more on 2-D and 3-D Plots 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!