Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
38 lines (27 sloc) 543 Bytes
% Matrix Declaration
m1 = [ 1, 1, 20;
0, 1, 0;
0, 0, 1];
% or m = [ 1, 1, 0;0, 1, 0;0, 0, 1];
m2 = [4, 5, 1;
1, 0, 3;
1, 9, 2];
% Column Vector:
m3 = [1;2;3;4];
% Row vector:
m4 = [1,2,3,4];
% A 2x3 vector
m5 = [1,2 ; 3,4 ; 5,6];
% A zeros Matrix
m6 = zeros(20, 7);
% A ones Matrix
m7 = ones(4, 20);
% Identity Matrix
m8 = eye(10);
m9 = eye(4, 6)
% Linearly Spaced Vector
m10 = linspace(1, 10, 10);
% Logarithmically spaced vectors
m11 = logspace(1,5,10);
m12 = logspace(1, 8, 8);
m13 = logspace(1, 8);