Having issues plotting with imaginary values. Need help checking results.
14 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens

The question I am trying to complete is stated in the given image. This is what I have so far but I'm thinking it is incorrect and could use some help debugging. I need to plot H vs Omega
clc
clear all
fr=linspace(0,4,100);
dr1 = 0;
dr2 = 0.1;
dr3 = 0.2;
dr4 = 0.4;
dr5 = 0.5;
H1=1./((1-fr.^2)+(2*dr1*fr).^2).^(0.5)
omega1 = (180/pi)*atan((2*dr1*fr)./(1-fr.^2))
plot(imag(H1),omega1)
hold on
H2=1./((1-fr.^2)+(2*dr2*fr).^2).^(0.5)
omega2 = (180/pi)*atan((2*dr2*fr)./(1-fr.^2))
plot(imag(H2),omega2)
H3=1./((1-fr.^2)+(2*dr3*fr).^2).^(0.5)
omega3 = (180/pi)*atan((2*dr3*fr)./(1-fr.^2))
plot(imag(H3),omega3)
H4=1./((1-fr.^2)+(2*dr4*fr).^2).^(0.5)
omega4 = (180/pi)*atan((2*dr4*fr)./(1-fr.^2))
plot(imag(H4),omega4)
H5=1./((1-fr.^2)+(2*dr5*fr).^2).^(0.5)
omega5 = (180/pi)*atan((2*dr5*fr)./(1-fr.^2))
plot(imag(H5),omega5)
0 commentaires
Réponses (1)
KSSV
le 30 Nov 2016
N = 100 ;
fr=linspace(0,4,N);
dr = [0; 0.1; 0.2; 0.4; 0.5];
H = zeros(length(dr),N) ;
omega = zeros(length(dr),N) ;
for i = 1:length(dr)
H(i,:)=1./((1-fr.^2)+(2*dr(i)*fr).^2).^(0.5) ;
omega(i,:) = (180/pi)*atan((2*dr(i)*fr)./(1-fr.^2)) ;
end
figure ;loglog(fr,abs(H),'r') ;
figure ; plot(fr,omega,'b') ;
Go through the text book of the concepts once, find out what to plot w.r.t what. I did it long ago and unable to recollect.
0 commentaires
Voir également
Catégories
En savoir plus sur Line Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!