Вы находитесь на странице: 1из 4

2-D Plots

>>x=0:0.5:10;
>>y=sin(x);
>>plot(x,y);

>>title(Graph of sine function);


>>xlabel(X values);
>>ylabel(Y=sin(x));

>>t=linspace(0,2*pi);
>>x=sin(t);
>>y=cos(t);
>>plot(t,x,*,t,y,-)
>>legend(x=sin(t),y=cos(t))
>>grid

r=input(enter the radious of the circle:)


theta=linspace(0,2*pi,100);
x=r*cos(theta);
y=r*sin(theta);
plot(x,y);
axis(equal);
title(circle of given radius r)

theta=linspace(0,2*pi,100);
x=cos(theta);
y=sin(theta);
subplot(1,2,1)
fill(x,y,g); axis(square);
subplot(1,2,2)
fill(x,y,g); axis(square);
view(3)

%create plots
Subplot(2,1,1);
Loglog(f,amp);
Title(amplitude response);
Xlabel(frequency(Hz));
Ylabel(output/input ratio);
Grid on;

Subplot(2,1,2);
semiLogx(f,phase);
Title(phase response);
Xlabel(frequency(Hz));
Ylabel(output-input phase(rad));
Grid on;

Вам также может понравиться