I want to generate Heatmap for irregular Time series data

8 ビュー (過去 30 日間)
vignesh mohan
vignesh mohan 2021 年 6 月 16 日
編集済み: vignesh mohan 2021 年 6 月 16 日
Dear all
I am new for matlab. I tried to plot a heat map for a dataset but it doesnt work and sample graph format is also attached for reference which i need to plot and i attached a sample data. I had tried using the below following codes. So kindly help me to resolve this issus. Thank you in advance.
x = dta(:,1);
y = dat(:,83);
z = dat(:,2:82);
tbl = table(x,y,z);
h = HeatMap(tbl,'x','y','ColorVariable','z','ColorMethod');
Error using HeatMap
Expected DATA to be one of these types:
numeric, bioma.data.DataMatrix
Instead its type was table.
Error in bioma.util.validateMatrix (line 10)
validateattributes(data, {'numeric', 'bioma.data.DataMatrix'},...
Error in HeatMap/setDisplayDataOnly (line 784)
bioma.util.validateMatrix(data, 'DATA', 'HeatMap')
Error in HeatMap/setDisplayData (line 779)
obj = setDisplayDataOnly(obj, data);
Error in HeatMap/set.Data (line 523)
setDisplayData(obj, data)
Error in HeatMap (line 366)
obj.Data = data;
  2 件のコメント
SALAH ALRABEEI
SALAH ALRABEEI 2021 年 6 月 16 日
try just heatmap(x,y,z)
vignesh mohan
vignesh mohan 2021 年 6 月 16 日
hai salah i tried that also but it doesn't work it is showing error i will try again and let you know thank you

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

回答 (1 件)

KSSV
KSSV 2021 年 6 月 16 日
編集済み: KSSV 2021 年 6 月 16 日
T = readtable('dat.csv') ;
x = T.(1) ;
x(1) = [] ;
x = datetime(datestr(x)) ;
y = table2array(T(1,2:end)) ;
data = table2array(T(2:end,2:end)) ;
pcolor(x,y,data')
shading interp
colorbar
  4 件のコメント
KSSV
KSSV 2021 年 6 月 16 日
Variable t is x... Typo error.. Edited the answer.
vignesh mohan
vignesh mohan 2021 年 6 月 16 日
編集済み: vignesh mohan 2021 年 6 月 16 日
I changed it and it is going good till pcolor(x,y,data') Error using pcolor (line 63) Data inputs must be real. This above error is pop up. Next what I have to do KSSV.

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

カテゴリ

Help Center および File ExchangeData Distribution Plots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by