Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Simple doubt in MATLAB- Matrix elements

Status
Not open for further replies.

Shweta_S

Member level 3
Joined
Jun 20, 2006
Messages
59
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Location
Chennai
Activity points
1,655
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.
 

This is because of imread result format - uint8. Try to change - F=double(F); for example
 
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top