Professional Documents
Culture Documents
Exercise 4 Program To Find The Solution For System of Equations
Exercise 4 Program To Find The Solution For System of Equations
Exercise 4 Program To Find The Solution For System of Equations
end
end
for i=1:3
b(i,1)=input("Enter the constants");
end
ainv=inv(a);
x=ainv*b;
disp("The solution:")
disp(x);
OUTPUT:
Exercise 5
1.
x=[0:0.01:20];
y=sin(x);
plot(x,y)
2.
x=[0:pi/10:pi];
yl=cos(x);
y2=sin(x);
plot(x,y1,x,y2)
3.
x=[1 5 2.7 3 7 4.8];
explode=[0 1 0 0 1 0];
pie(x,explode)
colormap hsv
4.
x=[-2*pi:pi/6:2*pi];
y=tan(x);
plot(x,y,'-.bd')
5.
x=0:0.1:pi;
y1=sin(x);
subplot(2,2,1);
plot(x,y1);
subplot(2,2,2);
y2=cos(x);
plot(x,y2);
y3=x.^3;
subplot(2,2,3);
plot(x,y3);
subplot(2,2,4);
y4=exp(-x);
plot(x,y4);