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,

 採用された回答

Star Strider
Star Strider 2018 年 10 月 31 日

0 投票

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 件のコメント

Bhushan Patil
Bhushan Patil 2018 年 10 月 31 日
Wow,Thanks! One thing is that instead of Tr.' using Tr gives proper result.
Star Strider
Star Strider 2018 年 10 月 31 日
As always, my pleasure!
If you have the two other matrices, ‘Tr’ will plot correctly.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by