Corrplot function : setup Variable name

3 ビュー (過去 30 日間)
Nicola Lisi
Nicola Lisi 2021 年 12 月 26 日
コメント済み: Khanh Dang 2023 年 1 月 10 日
I am using the function corrplot reading a matrix in one Excel file.
The first row of the Excel file contains the name of Variables that I would like to see on the left and down of the result plot.
Instead I see: Var1 Var2 .....
Please someone can help me to unserstand how to define the name of Variables on the Excel file ? Or how I can prepare a text data file ?
Thanks.
Nicola
  2 件のコメント
Voss
Voss 2021 年 12 月 26 日
Please share the code you are using to read the Excel file.
Nicola Lisi
Nicola Lisi 2021 年 12 月 27 日
編集済み: Walter Roberson 2021 年 12 月 27 日
Simple two lines of code:
data = xlsread("myExcelFile.xlsx");
corrplot(data);
As I wrote,the first row of Excel file contains the variable name.

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

採用された回答

Walter Roberson
Walter Roberson 2021 年 12 月 27 日
T = readtable("myExcelFile.xlsx");
data = table2array(T);
vars = T.Properties.VariableNames;
corrplot(data, 'varNames', vars)
  1 件のコメント
Khanh Dang
Khanh Dang 2023 年 1 月 10 日
Hi Walter Roberson,
Please help me how to change the fontsize and color of subplots in the correlation matrix which is plotted by corrplot function?
I need a help immediately, I am on roadblock to complete report now.
Thanks advance!

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

その他の回答 (1 件)

Nicola Lisi
Nicola Lisi 2021 年 12 月 27 日
Thanks a lot for the suggestion !!!
Regards and Happy New Year !!!

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by