Reading data with Strcat and alternative

1 回表示 (過去 30 日間)
Francesco Milani
Francesco Milani 2020 年 4 月 25 日
回答済み: Walter Roberson 2020 年 4 月 25 日
variable = xlsread('data.xlsx','Sheet', strcat('B', i_cell, ':G', f_cell));
In the above example I undestand that I am reading a specific sheet of the excel file but I dont get what " strcat('B', i_cell, ':G', f_cell)); " actually does.
Is there another way of writing the above code in a more easy way, by using another function instead of strcat?
Thanks in advance!

採用された回答

Walter Roberson
Walter Roberson 2020 年 4 月 25 日
range = sprintf('B%d:G%d', start_row, end_row); %where start_row and end_row are numeric
variable = xlsread('Data.xlsx', 'Sheet', range);
However it is confusing that you have something that looks like a range as a sheet name.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by