how to get string as output from inputdlg?
5 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone,
In the following script when I am trying to get sheet name from user by inputdlg as string to use for xlsread gives me the error:
Error using xlsread (line 146)
Sheet argument must be a string scalar, a character vector, or an integer.
Error in try_input (line 17)
data = xlsread(filename ,sheet ,xlRange);
the related scripts is:
sheet = inputdlg('Enter the input sheet name please:',...
'Input', [1 50]);
xlRange = 'D2:E44509';
data = xlsread(filename ,sheet ,xlRange);
Thanks.
0 件のコメント
採用された回答
Dennis
2019 年 5 月 20 日
inputdlg returns a cell array and not a string.
Try
data = xlsread(filename,sheet{1},xlRange);
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Characters and Strings についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!