Monday, 28 April 2014

matlab commands



Mean
A=[1 2 3 4;5 6 7 8];
i)                    mean (A)=mean(A,1)=[3,4,5,6]; %column-wise mean
Explanation:
1 2 3 4
5 6 7 8
---------
3 4 5 6
ii)                   mean(A,2)= [2.5,4.5];
1 2 3 4-----(1+2+3+4)/4 = 10/4 =2.5
5 6 7 8-----(5+6+7+8)/4 = 26/4 =4.5

Size
size(A,2) =  4 %number of columns
size(A,1) = 2%number of rows

We Normalize images to reduce the error due to lighting conditions

A=
1 2 3 4
5 6 7 8

A'=
1 5
2 6
3 7
4 8

temp=A'(:);
=
1
2
3
4
5
6
7
8


If A=
1 2
3 4
-----
2 3

here n-1= 2-1=1;
std(A)=

[√ (1-2)2+(3-2)2/(2-1)     √ (2-3)2+(4-3)2 /(2-1) ]     =[ √2/1    √2/1] =  [√2    √2]= [1.414   1.414];

Sum(A,1)=sum(A)=[4 6]
Sum(A,2)=[3 7]%row wise sum

A(:,1).^2
=
1
9


A= 1       B= 4
   2          5
   3          6

A’*B =32

[1 2 3]*  4           4+
          5  =        10
          6           18
                    -------
                      32     

 
img=uint8(image);   %converts to unsigned 8-bit integer. Values range from 0 to 255

Normalize cheyataniki  its own mean tho minus chestamu

No comments:

Post a Comment