how to plot complex functions of phase and amplitude

5 views (last 30 days)
I am trying to use f(t)=(1+0.25i)t–2.0 to plot the amplitude and phase of function f for 0 less than or equal to t less than or equal to 4 on two separate subplots within a single figure.
  2 Comments
SP
SP on 29 Oct 2018
can you help me again;
I am trying to create an array of 100 input samples in the range of 1 to 100 using the linspace function, and plot the equation y(x)=20 log10(2x) on a semilogx plot. I would also like to draw a solid blue line of width 2, and label each point with a red circle. And I want to create an array of 100 input samples in the range of 1 to 100 using the logspace function, and plot the equation y(x)=20 log10(2x) on a semilogx plot with a solid red line of width 2, and label each point with a black star.
SP
SP on 5 Nov 2018
hi I would greatly appreciate your help again I am kind of stuck,
I am trying to create the spiral of archimedes by the equation r = θ and r is the distance of a point from the origin and θ is the angle of that point in radians. I am trying to plot the spiral of archimedes for 0 less than or equal to θ less than or equal to 6pi when k =0.5 so far I have this:
>> theta=0:pi/6:6*pi;
>> k=0.5;
>> r=k*theta;
>> polarplot(theta,r)
However I am not getting a regular spiral

Sign in to comment.

Accepted Answer

Star Strider
Star Strider on 29 Oct 2018
Try this:
f = @(t) (1+0.25i).*t-2.0;
t = linspace(0, 4);
figure
subplot(2,1,1)
plot(t, abs(f(t)))
title('Amplitude')
subplot(2,1,2)
plot(t, angle(f(t)))
title('Phase')
  5 Comments
James Calandro
James Calandro on 10 Mar 2021
Thank you so much! This was exactly what I needed.
Star Strider
Star Strider on 10 Mar 2021
James Calandro — My pleasure!
(A Vote would be appreciated!)

Sign in to comment.

More Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!