MATLAB: Plotting a 2D Heat map for a square

2d platecolour mapdistributionheat mappredictingsurface plottemperaturethermal

Hi,
I have 9 Data points corresponding to temperatures within a 2d square, distributed as a 3 x 3 grid. I would like to create a colour plot whereby I have blue (cold) and red (hot) regions respectively. But I would like to have it blended such that intermediate temperatures are orange and slowly transition to red or blue. Basically if predicting the temperature at all locations. Treat the square as a 5 x 5 where the 3 x 3 inner points are known and the temperature along the boundaries are constant and known.
Please let me know if this makes sense.

Best Answer

Read about pcolor and colormap
N = 5 ;
x = linspace(0,1,N) ;
y = linspace(0,1,N) ;
T = rand(N) ;
pcolor(x,y,T) ;
colorbar
% colormap(jet)
Related Question