Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

New to MATLAB?

Thread Subject:
Heat map generation of a floor plan image

Subject: Heat map generation of a floor plan image

From: Nazmul Islam

Date: 4 Aug, 2012 04:44:08

Message: 1 of 2


I want to generate a heat map image of a floor. I have the following things:

1. A black & white .png image of the floor
2. A three column array stored in Matlab.
 -- The first two columns indicate the X & Y coordinates of the floorpan image
 -- The third coordinate denotes the "temperature" of that particular coordinate

I want to generate a heat map of the floor that will show the "temperature" strength in those coordinates. However, I want to display the heat map on top of the floor plan so that the viewers can see which rooms lead to which temperatures.

Is it possible to do this in Matlab?



Subject: Heat map generation of a floor plan image

From: Sadik

Date: 4 Aug, 2012 09:26:10

Message: 2 of 2

Hi Nazmul,

You can first show the floor plan. Then, you can do a reshape to your temperature map to make it a matrix that is of the same size as the floor plan. Now, you can say hold on to the floor plan figure and show the temperature using imagesc. But make sure you set the the FaceAlpha property of the temperature map.

Here is a very crude example that can be wrong but you can rectify by looking at the documentation.

temperatureMap = reshape(M(:,3),size(floorPlan)); % You had said the third column gives the map. You need to make sure that reshape does not mess up the location info. So, the best way is to do reshape on the first two columns to see if the coordinates are set correctly.

axis image
hold on
h = imagesc(temperatureMap);

Something like this. You can make a search on the keywords that I pointed to above.


Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us