How do I plot temperature distribution over a plate?

I have X and Y co-ordinates as vector,
  • y=[0;0;0;.1;.1;.1;.2;.2;.2];
  • x= [0;0.15;.3;.2;.4;.25;.5]; and
  • T=[578.6669;560.5492;539.8550;278.7484;269.1011;145.0386;37.6087;31.3801;24.8135];How do I PLOT temperature distribution, I want it to look something like this,

 采纳的回答

To begin, try this:
y=[0;0;0;.1;.1;.1;.2;.2;.2];
x= [0;0.15;.3;.2;.4;.25;.5];
T=[578.6669;560.5492;539.8550;278.7484;269.1011;145.0386;37.6087;31.3801;24.8135];
yr = reshape(y, 3, []);
Tr = reshape(T, 3, []);
figure
contourf(Tr.')
I used ‘y’ to figure out how to use reshape with ‘T’ There appears to be a problem with ‘x’, because it does not demonstrate the same pattern as ‘y’, and only has 7 elements (thje others have 9). When you correct ‘x’ and reshape it, you can use:
figure
contourf(xr, yr, Tr.')

2 个评论

Wow,Thanks! One thing is that instead of Tr.' using Tr gives proper result.
As always, my pleasure!
If you have the two other matrices, ‘Tr’ will plot correctly.

请先登录,再进行评论。

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Annotations 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by