フィルターのクリア

Error when selecting variables from an Excel sheet

4 ビュー (過去 30 日間)
Mohamed Ahmed
Mohamed Ahmed 2022 年 4 月 23 日
コメント済み: Mohamed Ahmed 2022 年 4 月 23 日
The code line
opts = spreadsheetImportOptions("VariableNamesRange",5, ...
"SelectedVariableNames",{'Sample Name'})
returns
Unknown variable name: 'Sample Name'.
opts = matlab.io.spreadsheet.SpreadsheetImportOptions(varargin{:});
Why am I receiving this error message? And any help to solve this problem will be much appreciated. Many thanks in advance.

採用された回答

Simon Chan
Simon Chan 2022 年 4 月 23 日
Better to define the Variable Names already in the spreadsheet as follows:
opts = spreadsheetImportOptions("VariableNamesRange",5, 'VariableNames',{'Var1','Var2','Sample Name','Var3'}...
"SelectedVariableNames",{'Sample Name'})
  1 件のコメント
Mohamed Ahmed
Mohamed Ahmed 2022 年 4 月 23 日
Yes, thank you Simon. I'll do that. Much appreciated.

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by