How to plot cosine of complex function of third degree?

I plot the phase of this function
fb(z) = (0.1496 − 0.1692i)z^−1 + (0.2472 + 0.0916i)z^−2 + (−0.8196 − 0.3718i)z^−3
by using this command
surf(re_z,im_z,angle(f_of_z_result),'EdgeColor','none'); .
My question is how can me plot the cosine of this function?
I appriciate any help

6 Comments

do you mean the following?
surf(re_z, im_z, abs(f_of_z_result),'EdgeColor','none');
Thank you Chunru, your command plot the magnitude of this polynomial (|f(z)|).
but I meant,
how to plot the cosine of this function?
I really apriciate any help.
The cosine of a complex-valued function is complex-valued. So you will have to tell us what you want to plot:
cos(abs(f_of_z_result)), abs(cos(f_of_z_result)), angle(cos(f_of_z_result)), cos(angle(f_of_z_result)),...
There are many possibilities.
Hi Torsten
Thank you very much for your answer. Because I study the behaviour of this function, could you please help me to plot all these possibilities?
I really appreciate your efforts.
Just insert the expression you want in the surf command instead of abs(f_of_z_result).
Thanks Torsten so much, I really appriciate your efforts.
I will use all these commands to study my function.

Sign in to comment.

Answers (1)

Hi Aisha,
I understand that you are trying to plot the cosine of the given symbolic relation in MATLAB using "surf" plot. In this answer I'm make the following assumption based on the information provided:
  1. Variable "z"is a complex variable represented as re_z + i*im_z
  2. re_z and im_zare real doubles that represent axes in the returned 3D plot.
  3. Since the cosine of a complex valued function is complex, I assume that you want to plot the absolute value.
Based on these assumptions, you can use the following to obtain the plot:
surf(re_z, im_z, abs(cos(f_of_z_result)),'EdgeColor','none');
"abs" and "cos"are in-built MATLAB functions that return the absolute and cosine value of the argument respectively.
If re_z andim_z are complex-valued, use the "abs()" function to plot your result:
surf(abs(re_z), abs(im_z), abs(cos(f_of_z_result)),'EdgeColor','none');
MATLAB has nice documentation for both functions. I have provided their links below:
  1. abs() function - https://in.mathworks.com/help/matlab/ref/abs.html
  2. cos() function - https://www.mathworks.com/help/symbolic/cos.html
Hope this helps.
Regards,
Nipun

Categories

Asked:

on 11 Jul 2022

Answered:

on 8 Nov 2023

Community Treasure Hunt

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

Start Hunting!