how to plot this two equatio and the resutant output is shown in the figure

 Akzeptierte Antwort

Birdman
Birdman am 26 Mär. 2020

0 Stimmen

Try this:
alpha=1;Wcr=10;
syms w
Mag(w)=piecewise(w<Wcr,20,w>=Wcr,-26.144+20*alpha*log(w));
w=logspace(-1,3,1000);
semilogx(w,Mag(w));grid on;xlabel('Frequency');ylabel('dB')

9 Kommentare

Irshad Baruah
Irshad Baruah am 26 Mär. 2020
its showing error in
Error in matlab_program (line 5)
Mag(w)=piecewise(w<Wcr,20,w>=Wcr,-26.144+20*alpha*log(w));
Irshad Baruah
Irshad Baruah am 26 Mär. 2020
this is the paper , i want to find the fractional zero part i.e figure 1
Birdman
Birdman am 26 Mär. 2020
which version of MATLAB are you using?
Irshad Baruah
Irshad Baruah am 26 Mär. 2020
Matlab R2013a
Birdman
Birdman am 26 Mär. 2020
ok then, try this:
hold off;
alpha=1;Wcr=10;
w1=logspace(-1,log10(Wcr),1000);w2=logspace(log10(Wcr),3,1000);
Mag1=20*ones(1,numel(w1));Mag2=@(w2) 20*alpha*log10(w2);
semilogx(w1,Mag1);hold on;semilogx(w2,Mag2(w2));grid on;xlabel('Frequency');ylabel('dB')
Irshad Baruah
Irshad Baruah am 27 Mär. 2020
Thank you Birdman it's working if I face any problem I let you know again thanks for helping me out
Birdman
Birdman am 27 Mär. 2020
You are welcome. You can accept the answer if it helped.
Irshad Baruah
Irshad Baruah am 27 Mär. 2020
alpha value should be fractional,in this code if i chang the alpha value the graph got cut
Birdman
Birdman am 30 Mär. 2020
Hello Irshad,
Sorry for the late reply. There has been something in the code that I missed, so the following code is working:
hold off;
alpha=0.09;Wcr=10;
w1=logspace(-1,log10(Wcr),1000);w2=logspace(log10(Wcr),3,1000);
Mag1=20*alpha*ones(1,numel(w1));Mag2=@(w2) 20*alpha*log10(w2);
semilogx(w1,Mag1);hold on;semilogx(w2,Mag2(w2));grid on;xlabel('Frequency');ylabel('dB')

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Tags

Gefragt:

am 26 Mär. 2020

Kommentiert:

am 30 Mär. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by