% Script to do basic matrix manipulations in Matlab
clear all
close all
clc

A=[4 3 4; 4  6 8; 3 6 6 ];
b =[35 22 40]';

disp('Define A=[4 3 4; 4  6 8; 3 6 6 ]')
disp('Define b =[35 22 40] transposed ')

A
b
 
% y = A * B
% Multiply a (3x3) matrix by a  (3x1) matrix
% Yields a (3x1) matrix

disp('Find  y=A*b')
y = A*b
pause

% Solution to set of linear equations
% Ax = B

disp('Find  A\b')
x = A\b                % Uses the backslash operator
pause

% Same solution using standard linear algebra operations
% Calculate the inverse of A
% Multiply by matrix b

disp('Find  inv(A) * b')
x= inv(A) * b

% More operations using the matrix A (3x3)

disp('Find  c= A ^ 2')
c= A^2
pause

disp('Find  d=A*A')
d = A*A
pause

disp('Find  e=A*3')
e=A*3
pause

disp('Find  g=A+5')
g=A+5




