Error when selecting variables from an Excel sheet
조회 수: 1 (최근 30일)
이전 댓글 표시
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
채택된 답변
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'})
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!