MATLAB: How to plot quiver with an input of Temperature data

quivertemperature

I have temperature data of a sample (V=(28,30,4997)). Each V(:,:,i) is a matrix with temperature values. I want to plot a quiver of temperature dissipation/accumulation and temperature image at the same time but i am a bit confused with inputs for u and v vectors. What u and v should be if i have only matrices of temperature?
My code:
[x,y]=meshgrid(1:1:30,1:1:28);
k=4997;
cnt=0;
for i=1:k
u(:,:,i)=V(:,:,i);
v(:,:,i)=V(:,:,i);
%figure
imagesc(V(:,:,i));
hold on
axis tight
q=quiver(x,y,u(:,:,i),v(:,:,i))
q.AutoScale='on';
q.AutoScaleFactor=0.8;
colormap jet
cnt=i;
title(cnt);
pause (0.1)
end

Best Answer

Presumably your heat-flux is just proportional to the temperature gradient (assuming constant and isotropic heat conductivity), for that I would start with:
[dTdx,tTdy] = gradient(V(:,:,i));
u(:,:,i) = -heat_conductivity*dTdx;
v(:,:,i) = -heat_conductivity*dTdy;
If you want total change in thermal energy per pixel you'll have to add local heating and subtract local cooling, for this the contribution of heat condution will be proportional to the divergence of the heat-flux. If you image a fluid that moves you'll also have to take the effect of convection into account. If the above suggestion doesn't work you have to clarify your question.
HTH
Related Question