- How many sheets Frequency Sweep.xlsx has?
- What value you're using for i?
- What value you're using for start?
- What OS are you using?
readmatrix is no longer able to read specific sheets using an integer that represents the location of the sheet (starting MATLAB 2019b)
19 次查看(过去 30 天)
显示 更早的评论
I used this code to load specific sheets from my excel file into MATLAB.
index=readmatrix('Frequency Sweep.xlsx','Sheet',i,'Range',sprintf('A%d',start));
this would load data from sheet number " i ". But since I have updated to MATLAB 2019b, this code doesn't work anymore and it only calls the data from the first sheet.
Does anyone know how to fix this?
Thank you
2 个评论
Steven Lord
2019-10-25
Can you answer these questions?
Amir Darabi Noferesti
2019-10-25
I have attached the excel file. It has 10 sheets and "i" is in a for loop, starting from 1 to 10.
"start" is also where the data starts in the spreadsheet, which is 63.
My OS is windows 10, 64-bit version 1903.
I just ran the same code in MATLAB 2019a and it worked. I guess there is something wrong with the newer version.
回答(1 个)
Vinai Datta Thatiparthi
2019-11-1
Hey Amir!
Use the UseExcel parameter to get your expected output. From R2019b revision of MATLAB, UseExcel is also used as a logical value that specifies weather or not to read the spreadsheet file using Microsoft ® Excel ® for Windows ®.
index=readmatrix('Frequency Sweep.xlsx','UseExcel',1,'Sheet',i,'Range',sprintf('A%d',start));
If you wish to read further on how to work with readmatrix, enter this command in the command window -
help readmatrix
Hope this helps!
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!