Skip to content

MatLab Results

For this last week, we were assigned to run some problems through MatLab, a programming language that engineers often use. In it we solved matrices and polynomials, simple things, but I reckon that there is a lot more to learn. Although complicated to learn initially, once I hooked onto the idea, it was fairly easy to execute. I plan to learn this language more in depth to be of use in my future.

My results⬇️

1)A = [1 1 1; 1 -1 1; 1 2 -1] B = [6;6;2];
X = inv(A)*B

A=

111

1 1

X= 4

0 2

2)
t=0:pi/100:2*pi;
y=sin(t);
z=cos(t);
x=cos(t).^2
plot(t,y,t,z,t,x)
xlabel('DOMAIN') ylabel('RANGE') legend('sin(t)','cos(t)','cos(t).^2')

-1 1 2 -1

3)
z = polyval([1; 3; -100; 54.286; 1; 3; 6],6) roots([1; 3; -100; 54.286; 1; 3; 6])

z=

-4.7830e+04

ans =

-11.8359 + 0.0000i 8.2813 + 0.0000i 0.7639 + 0.0000i -0.3783 + 0.0000i 0.0845 + 0.4524i 0.0845 - 0.4524i

Leave a Reply

Your email address will not be published. Required fields are marked *