How to plot angle (in radians) versus phase shift?
Afficher commentaires plus anciens
Hi,
I want a profile with phase angle plotted against angle in radians.
Presently I have a code with phase angle plotted against a linear distance which is as below.
Need your valuable advice how to do the necessary changes in this code.
Also I need to determine its slope.
Sincerely,
rc
clc;
clear;
phi_1 = [0.1724*pi 0.1472*pi 2.18*pi 2.25*pi 4*pi 3.588*pi 1.012*pi 4.112*pi 4.31*pi 4.25*pi 0.832*pi];
x1 = linspace(0,1,11);
coefficients1=polyfit(x1,phi_1,1);
slope1=coefficients1(1);
intercept1=coefficients1(2);
figure(1)
hold on
plot(x1,phi_1,'o')
plot([0 1],intercept1 + slope1*[0 1])
1 commentaire
David Goodmanson
le 20 Juin 2023
Hi Rahul,
you can shorten up the code by eliminating the slope and intercept calculations and plotting the line with
plot([0 1],polyval(coefficients1,[0 1])).
It's not possible to say anything about plotting using angle without knowing the lower and upper limits of the angle. Anyway, any kind of straight line fit to this data looks pretty dubious.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Waveform-Level Simulations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
