Professional Documents
Culture Documents
%3zadatak
%a
A=[1 1 1; 2 5 -3; -1 -1 2];
b=[0; 7; 9];
x=A\b
%b
A=[2 1 3; 4 -2 3; 1 3 8];
b=[5; 8; 5^1/2];
x=inv(A)*b
%c
syms x y z real
S=solve('2*x+y+3*z=5','4*x-2*y+3*z=8','x+3*y+8*z=5^1/2')
X=S.x, xx=double(X)
Y=S.y, yy=double(Y)
%4
syms x y;
f=2*x^2/[sqrt(x^2+3*y^2)]
pretty(f)
fx=diff(f,x);
fx=simple(fx);
pretty(fx)
fy=diff(f,y);
fy=simple(fy);
pretty(fy)
%5
syms x
f=[x^3+3*x^2]/[(x+1)*(x^3+1)]
pretty(f)
I=int(f,0,3)
pretty(I)
%6
x1=-1:0.1:1;
y1=x1.^2;
x2=0:0.1:1;
y2=x2.*exp(x2);
x3=-1:0.1:0;
y3=sin(pi*x3);
plot(x1,y1,x2,y2,x3,y3)
grid on
legend('y1(x1)','y2(x2)','y3(x3)')