%arrays.m

%Examples using arrays

%Enter data for array (or matrix) A
A=[ 1   2   4; 
   4.4 5.9 6.8;
   7.2 8.0 9.5];

%Get individual values from matrix
a11=A(1,1);%Basic scheme A(row,col)
a32=A(3,2);

%Get entire column from A
A1=A(1:3,1);%Basic scheme A(1:nrows,col)

%Get entire row from A
Ar1=A(1,1:3);%Basic scheme A(row,1:ncols)

%Adding up values in column one of matrix A
asum=0.0;
for i=1:3
    asum=asum+A(i,1);
end
