How to plot pcolor in matlab

13 ビュー (過去 30 日間)
vignesh mohan
vignesh mohan 2021 年 12 月 9 日
コメント済み: Andebo Waza 2024 年 12 月 31 日
Hello everyone,
i want to plot pcolor plot in matlab but i tried i cannot do it. I add my data here and code also
x = [13-04-2021 00:00 13-04-2021 01:00 13-04-2021 02:00 13-04-2021 03:00 13-04-2021 04:00] like this till 14-04-2021 23:00:00
y = [10.23 11.16 12.19 13.31 14.54 15.88 17.35 18.96 20.72 22.66 24.77 27.1 29.65 32.45 35.53 38.92 42.65 46.77 51.32]
z = [2.27E+03 3.94E+03 4.48E+03 6.26E+03 3.18E+03 3.78E+03 5.37E+03 5.60E+03 6.35E+03 8.47E+03 1.05E+04 1.05E+04
1.36E+04 1.12E+04 8.48E+03 3.96E+03 5.84E+03 4.55E+03 3.65E+03 6.17E+03 7.48E+03 6.98E+03 9.84E+03 1.11E+04
5.72E+04 6.90E+04 5.64E+04 4.71E+04 1.94E+04 6.37E+03 6.59E+03 6.89E+03 8.81E+03 9.70E+03 8.11E+03 9.59E+03
1.26E+04 1.34E+04 1.69E+04 1.99E+04 2.18E+04 2.62E+04 2.98E+04 9.09E+03 5.16E+03 8.73E+03 3.96E+03 4.95E+03
5.16E+03 4.06E+03 4.24E+03 6.17E+03 7.99E+03 8.20E+03 6.68E+03 1.07E+04 1.24E+04 1.36E+04 1.78E+04 1.89E+04]
my x data is in one range and y is in another range and my z data is in different size range.
how to plot that graph?
i hope i will get the answer for this thank you in advance.
[x,y] = meshgrid(x,y);
Pcolor(x,y,z);
  5 件のコメント
vignesh mohan
vignesh mohan 2021 年 12 月 9 日
Hello Rik i had attached reference graph just have a look then you will get some idea
vignesh mohan
vignesh mohan 2021 年 12 月 9 日
Hello Walter sir i had attached some sample data sheet also. my column name should come in my y-axis date will come in my x-axis remaining all will come in z-axis.
i hope you will help me to come out from this sir i tired many way.
Thank you

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

回答 (1 件)

Walter Roberson
Walter Roberson 2021 年 12 月 9 日
filename = 'https://www.mathworks.com/matlabcentral/answers/uploaded_files/828415/Book1.xlsx';
T = readcell(filename);
x = [T{2:end,1}];
y = cell2mat(T(1,2:end));
z = cell2mat(T(2:end,2:end));
surf(x, y, z.', 'edgecolor', 'none');
  34 件のコメント
Walter Roberson
Walter Roberson 2024 年 12 月 30 日
Sorry, I do not know how to read python. In particular I do not know the meaning of np.ma.array especially in conjugation with the mask= parameter.
Andebo Waza
Andebo Waza 2024 年 12 月 31 日
@Walter Roberson, No worries. I managed to write the code.

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

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

製品


リリース

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by