plot every column in an excel sheet and the corresponding column in the second sheet in same box plot with header name as chart title.
6 ビュー (過去 30 日間)
古いコメントを表示
I have excel book with two sheet, both sheet have same headernames for each column, I want each column to be plotteed against it's corresponding similar colum from next sheet with the title of the chart as head name. Is there a small code to call read everycolumn and plot them?
Like below for all the columns in the sheet
1 件のコメント
Mathieu NOE
2023 年 1 月 10 日
hello
I don't understand how your x,y data are organized in your excel file
回答 (1 件)
J. Alex Lee
2023 年 1 月 10 日
T1 = readtable("example.xlsx","Sheet","TF off TS","NumHeaderLines",1);
T2 = readtable("example.xlsx","Sheet","No twist free off 31st TS","NumHeaderLines",1);
VarNames = T1.Properties.VariableNames;
fig = figure();
tl = tiledlayout(fig,"flow");
for k = 1:9
nexttile
x = T1.(VarNames{k});
y = T2.(VarNames{k});
c = categorical("sheet" + [ones(size(x));2*ones(size(y))]);
boxchart(c,[x;y])
title(VarNames{k})
end
fig = figure();
tl = tiledlayout(fig,"flow");
for k = 1:numel(VarNames)
nexttile
x = T1.(VarNames{k});
y = T2.(VarNames{k});
c = categorical("sheet" + [ones(size(x));2*ones(size(y))]);
boxchart(c,[x;y])
title(VarNames{k})
end
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Data Distribution Plots についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!