Shweta_S
Member level 3
Simple doubt in MATLAB- Product of two matrix elements
I read an image (gray scale) using imread function of MATLAB ( 'camerman.tif').
I got a matrix ( say F) of size 256x256.
I have another matrix, say A=[-1 0
. . . . . . . . . . . . .. . . . . . . . 0 1] ... (2x2 matrix)
In my program, at one point of the time I have to multiply A(1,1) and F(1,1)
I display the value of F(1,1) : I get 156 ......
I display the value of A (1,1): I get -1...
But when I display the value of A(1,1)*F(1,1), I get 0!!! NOT -156 Why is this so?
To be precise, disp(F(1,1)*A(1,1));
P.S. I tried the same thing out by having two simple matrices ( not with image), I'm getting the value correctly. Why is it not working when one of the i/p is an image? Am I missing something?
I am new to MATLAB. Please help.
Thanks in advance.
I read an image (gray scale) using imread function of MATLAB ( 'camerman.tif').
I got a matrix ( say F) of size 256x256.
I have another matrix, say A=[-1 0
. . . . . . . . . . . . .. . . . . . . . 0 1] ... (2x2 matrix)
In my program, at one point of the time I have to multiply A(1,1) and F(1,1)
I display the value of F(1,1) : I get 156 ......
I display the value of A (1,1): I get -1...
But when I display the value of A(1,1)*F(1,1), I get 0!!! NOT -156 Why is this so?
To be precise, disp(F(1,1)*A(1,1));
P.S. I tried the same thing out by having two simple matrices ( not with image), I'm getting the value correctly. Why is it not working when one of the i/p is an image? Am I missing something?
I am new to MATLAB. Please help.
Thanks in advance.