Hi, I am trying to import an xlsx file to a table using the following command:
trial_table = readtable(xlsx_file_path, opts, 'TreatAsEmpty',{'.','NA'});
However, I get the following error:
Error using matlab.io.spreadsheet.SpreadsheetImportOptions/readtable (line 339)'TreatAsEmpty' is not a recognized parameter. For a list of valid name-value pair arguments, see the documentation for readtable.
I read the documentation, and as far as I understand, 'TreatAsEmpty' should be a recognized name-value pair argument. In fact, when I used only the 'TreatAsEmpty' or the 'opts' input alone, the function worked!
trial_table = readtable(xlsx_file_path, 'TreatAsEmpty',{'.','NA'}); #this works trial_table = readtable(xlsx_file_path, opts); #this workstrial_table = readtable(xlsx_file_path, opts, 'TreatAsEmpty',{'.','NA'}); #this does not worktrial_table = readtable(xlsx_file_path, 'TreatAsEmpty',{'.','NA'}, opts);#this does not work
Any ideas why this is not working? Thanks
Best Answer