First Matlab Matrix operations >>a = 1:4 a = 1 2 3 4 >> 2*a ans = 2 4 6 8 >> 2 / a ??? Error using ==> / Matrix dimensions must agree. >> 2 ./a ans = 2.0000 1.0000 0.6667 0.5000 >> a .*a ans = 1 4 9 16 >> a .^(.5) ans = 1.0000 1.4142 1.7321 2.0000 >> b = a' b = 1 2 3 4 >> a*b ans = 30 >> b*a ans = 1 2 3 4 2 4 6 8 3 6 9 12 4 8 12 16 >> c=b*a c = 1 2 3 4 2 4 6 8 3 6 9 12 4 8 12 16 >> x=1:9 x = 1 2 3 4 5 6 7 8 9 >> y = reshape(x,3,3) y = 1 4 7 2 5 8 3 6 9 >> inv(y) Warning: Matrix is singular to working precision. ans = Inf Inf Inf Inf Inf Inf Inf Inf Inf >> y(3)=0 y = 1 4 7 2 5 8 0 6 9 >> inv(y) ans = -0.3333 0.6667 -0.3333 -2.0000 1.0000 0.6667 1.3333 -0.6667 -0.3333 >>