Hai i am trying to 'pcolor plot' for Time for 12 hrs(x-axis) and height(y-axis) height size [103 X 1].can you help me?please

5 ビュー (過去 30 日間)
Mr Thadi
Mr Thadi 2023 年 12 月 20 日
コメント済み: Mr Thadi 2023 年 12 月 27 日
Hai i am trying to 'pcolor plot' for Time for 12 hrs(x-axis) and height(y-axis) height size [103 X 1].can you help me?please

回答 (1 件)

Chunru
Chunru 2023 年 12 月 20 日
編集済み: Chunru 2023 年 12 月 21 日
t = (1:12);
h = (1:103);
z = exp(-h'.*t/200); % data
p = pcolor(t, h, z);
p.EdgeColor = "none";
clear
load(websave("data.mat","https://www.mathworks.com/matlabcentral/answers/uploaded_files/1573227/data.mat"))
figure;
% find the dimension of the data (max height of all cells)
n = size(data{1}, 1);
for i=1:length(data)
n = max(n, size(data{i}, 1));
end
x = nan(n, length(data));
% collect 2nd colum from all cell
for i=1:length(data)
x0 = data{i}(:, 2);
x(1:length(x0), i) = x0;
end
p = pcolor(x);
p.EdgeColor = 'none';
  3 件のコメント
Chunru
Chunru 2023 年 12 月 21 日
See the update above.
Mr Thadi
Mr Thadi 2023 年 12 月 27 日
Thank you Mr Chunru.you answer very clear.

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

カテゴリ

Help Center および File ExchangeStructured Data and XML Documents についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by