Xlsread input arguments?

14 ビュー (過去 30 日間)
Soumyatha Gavvala
Soumyatha Gavvala 2016 年 6 月 20 日
コメント済み: Soumyatha Gavvala 2016 年 6 月 21 日
I have a script which generates different range values for different runs, so I stored this data in variables,
startdata= x;
enddata= y;
xlsread(FileName,'startdata:enddata');
Obviously, I get this error:
Error using xlsread (line 247)
Data range 'startdata:enddata' is invalid.
Is there anyway I can assign my variable value to xlsread?
Thank you.

採用された回答

dpb
dpb 2016 年 6 月 20 日
Sure, write the translation from whatever x,y are to the character form...it's not clear what they represent, however, but if they're character strings then all you're missing is the concatenation...
x='A';
y='B';
rnge=[x ':' y];
data=xlsread(FileName,rnge);
If they're numeric you'll have to use num2str or sprintf or similar to build an appropriate string but it can be anything that results in a valid range expression as a character string (a cellstr won't work).
  1 件のコメント
Soumyatha Gavvala
Soumyatha Gavvala 2016 年 6 月 21 日
Thank you!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by