You are on page 1of 2

A= [4 2 -3;-1 1 3;2 5 7];

eig(A);
[V,D]=eig(A);
syms x1 x2 x3
s1=x2-3*x3+5
s2=2*x1+3*x2-x3-7
s3=4*x1+5*x2-2*x3-10
s=solve(s1,s2,s3)
solution=[s.x1,s.x2,s.x3];
t=0:0.01:2*pi;
y=sin(t);
plot(t,y);
grid on
xlabel('time');
ylabel('sin');
hold on;
y2=t;
plot(t,y2,'-. m');
xlabel('time');
ylabel('t');
grid on;
hold on;
y3=t-(t.^3)/factorial(3)+(t.^5)/factorial(5)+(t.^7)/factorial(7);
plot(t,y3,'-- g');
ylabel('y3');
xlabel('t');
grid on;
hold on;
%q3 b%
t=0:0.01:10*pi;
y=t.*cos(t);
plot(t,y,'g');
grid on;
xlabel('t');
ylabel('t.cost');
t=0:0.01:2*pi;
plot(t,exp(t),'r');
hold on
t=0:0.01:2*pi
plot(t,(100+exp(t)),'y')
hold on
legend('sin(t)','t','y3','y',' exp(t)','100+exp(t)')

%q5%
syms x
s1=exp(x.^8);
diff(s1);
s2=3*x.^3*exp(5);
diff(s2);
s3=5*x.^3-7*x.^2+3*x+6;
diff(s3);
%q6%
syms x

i1=abs(x)
int(i1,.2,.7)

You might also like