フィルターのクリア

Name a graph with the title of the sheets of excel

3 ビュー (過去 30 日間)
Ana Soph
Ana Soph 2020 年 6 月 4 日
コメント済み: Ana Soph 2020 年 6 月 4 日
Hi, i hope everyone have an awesome day, i have a little problem,
i do this program and everything is "ok" , but i have so much graphs and would like to add more sheets, so ... do you know what can i add to have the title of the sheets on every graph?
xlfile = 'RamYPabHumedad.xlsx';
[~, sheets] = xlsfinfo(xlfile);
cmonths = 19;
for i = 1:cmonths %iterate over the sheets
Datenum = xlsread('RamYPabHumedad.xlsx',i);
Ramiro = Datenum(:,1);
Pablo = Datenum(:,2);
Error1 = Ramiro-Pablo;
shname = i;
value = xlsread(xlfile, shname);
figure;
plot(Ramiro, Error1,'.r');
xlabel('Ramiro');
ylabel('Error');
title(sprintf('%s', shname));
end
Thanks a lot...
Best

採用された回答

Tommy
Tommy 2020 年 6 月 4 日
Perhaps like this?
xlfile = 'RamYPabHumedad.xlsx';
[~, sheets] = xlsfinfo(xlfile);
cmonths = 19;
for i = 1:cmonths %iterate over the sheets
Datenum = xlsread('RamYPabHumedad.xlsx',i);
Ramiro = Datenum(:,1);
Pablo = Datenum(:,2);
Error1 = Ramiro-Pablo;
shname = sheets{i}; % <---------------------- change here
value = xlsread(xlfile, shname);
figure;
plot(Ramiro, Error1,'.r');
xlabel('Ramiro');
ylabel('Error');
title(sprintf('%s', shname));
end
  1 件のコメント
Ana Soph
Ana Soph 2020 年 6 月 4 日
Awesome! have a wonderful day good man :)

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by