clear,clc,close all
% 0.1 Research
%The dot operator allows operations to be performed element by element,
%rather than in matrix form. This would be useful if you only wanted to
%multiply or divide elements in a matrix by their corresponding values
%in another matrix.
%This is the solution to assignment 5
%Initialization
A = [1 3 7 9; 6 4 2 1]; %Supress anything not to be displayed
B = [1 2 1; 0 1 0; 1 1 2; 0 0 1];
C = ([1 1 2; 2 3 4])';
%Statements/Declarations
D = (A*B)' + C %remeber ' transposes
E = C.*D; %Do not mistake for the dot() function!
E(1) = 12; E(3) = 16;
%Answer
E([[1:2:end],end]) %There are many ways to index!
%Part 2
%Reassigning Variables
A = [1 0 10; 11 3 1; 12 1 0];
b = [1 2 3]';
x = inv(A)*b