0
Problem in visualistion of the output

Respected Sir / Madam

I am plotting the magnitude and phase response of a transfer function in scilab. I have similar code for the same transfer function in matlab. My outputs in scilab are differing with that of matlab. Please help in this regard for drawing proper inference. I am posting the code I have developed. Your help will be priceless.
Yours sincerely
T.V.Chandra Shekar
clc;
clear;
close;
s = %s;
w = 0:0.01:2*%pi;
num1 = s^3+ 2*s^2 + 0.9*s + 1;
den1 = s^3 - 0.9*s + 0.8;
p = syslin('c',num1,den1);
disp(p.num);
subplot(2,1,1)
[h] = freq(num1,den1,w);
plot2d((w/%pi),abs(h));xgrid(color("green"));
a = gca();
a.x_location = "origin";
a.y_location = "origin";
xtitle('Frequency Response','f Frequency','Magnitude');
subplot(2,1,2)
plot2d((w/%pi),atan(h));xgrid(color("green"));
a = gca();
a.x_location = "origin";
a.y_location = "origin";
xtitle('Phase Response','f Frequency','Phase');


Scilab 09-12-17, 9:15 a.m. chandrashekar

Answers:

0

Is this code giving the right result

clc;
clear;
close;
s = %s;
w = 0:0.01:2*%pi;
num1 = s^3+ 2*s^2 + 0.9*s + 1;
den1 = s^3 - 0.9*s + 0.8;
p = syslin('c',num1,den1);
disp(p.num);
subplot(2,1,1)
[h] = freq(num1,den1,w);
plot2d((w/%pi),abs(h));xgrid(color("green"));
a = gca();
a.x_location = "origin";
a.y_location = "origin";
xtitle('Frequency Response','f Frequency','Magnitude');
subplot(2,1,2)
plot2d((w/%pi),atan(h)*180/%pi);xgrid(color("green"));
a = gca();
a.x_location = "origin";
a.y_location = "origin";
xtitle('Phase Response','f Frequency','Phase');

20-12-17, 9:16 p.m. ashutumho


Log-in to answer to this question.