Error when selecting variables from an Excel sheet
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Mohamed Ahmed
am 23 Apr. 2022
Kommentiert: Mohamed Ahmed
am 23 Apr. 2022
The code line
opts = spreadsheetImportOptions("VariableNamesRange",5, ...
"SelectedVariableNames",{'Sample Name'})
returns
Error using matlab.io.spreadsheet.SpreadsheetImportOptions
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.
0 Kommentare
Akzeptierte Antwort
Simon Chan
am 23 Apr. 2022
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'})
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Data Import from MATLAB finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!