MATLAB Answers

How can I export the entirety of an excel table to a matlab table/matrix?

2 views (last 30 days)
Vanessa Hernandez-Cruz
Vanessa Hernandez-Cruz on 27 Jul 2021
Answered: Shubham Khatri on 30 Jul 2021
I am trying to post-process data that can be found in a .xlsm file. First, I am trying to successfully export the data into MATLAB. I am not receiveng any error messages, the issue is that the output is not the specified range I am asking for. I tried using readtable, readmatrix, xlsread: they all have the same issue. I also tried the import tool, but that was also unsuccessful. I suspect the issue is that some cells are empty so that is somehow cofusing the command I am calling to import a range of the .xlsm file I am using. For reference, the range I am asking for is A147:RS1057. When I go back to double check the table MATLAB gives me with that actual range in the excel file, it is not the same. Any help would be appreicated, thank you!

Answers (1)

Shubham Khatri
Shubham Khatri on 30 Jul 2021
Hello,
It is slightly unclear what issue you are facing. I will be able to assist you better, if you can share some more details or the file. I As of now, I tried reproducing your issue. I created an xlsm file with multiple some cells empty and some with numeric and alphabetical values. I was able to import files with some unimportable values replaced by NaN (or some other value of choice). Please take a look at this answer, which might be of some help.
Also, take a look at documentaiton of import tool.
Hope it helps

Products


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by