unable read any ".xlsx" or ".xls" data
Show older comments
它無法讀取任何“ .xlsx”或“ .xls”數據。它甚至沒有報告命令窗口中的任何錯誤,而是當我雙擊其中任何一個時發出的簡單聲音。我使用win10,MATLAB2020b,office 2013。
我已經從MATLAB獲得了所有工具箱。並且Excel可以正常工作。這些“ .xlsx / .xls”可以“在matlab外部打開”,並且在以下情況下可以使用:
readtable('path_to.xlsx','Sheet','sheet_name')
如果我不僅要在命令窗口中打開表,而且要直接在MATLAB中打開“ .xlsx / .xls”,該如何解決?
10 Comments
Rik
on 17 Nov 2020
(approximate translation:)
It cannot read any ".xlsx" or ".xls" data. It didn't even report any errors in the command window, but a simple sound when I double-clicked any of them. I use win10, MATLAB2020b, office 2013.
I have obtained all toolboxes from MATLAB. And Excel can work normally. These ".xlsx/.xls" can be "opened outside matlab" and can be used in the following situations:
readtable('path_to.xlsx','Sheet','sheet_name')
If I not only want to open the table in the command window, but also directly open ".xlsx / .xls" in MATLAB, how can I solve it?
Rik
on 17 Nov 2020
What do you want to do? Do you want to read the Excel file as a cell array? Do you want to edit the Excel file directly from the variable editor?
Yu Jui Huang
on 18 Nov 2020
Rik
on 18 Nov 2020
You can't directly edit the excel file in Matlab. You can read and write to a file with xlsread and xlswrite.
Yu Jui Huang
on 18 Nov 2020
Yu Jui Huang
on 18 Nov 2020
KALYAN ACHARJYA
on 18 Nov 2020
Once you try to load with xlsread(''), is there any issue?
Yu Jui Huang
on 18 Nov 2020
Yu Jui Huang
on 18 Nov 2020
Rik
on 18 Nov 2020
From your screenshot it looks like xlsread works normally.
You should not confuse the import tool with actually editing the file.
Have you done a Matlab tutorial? You may consider doing the Onramp tutorial (which is provided for free by Mathworks). It should teach you the basics. I'm not sure if there is an excersize with loading and writing excel files, but there might be.
Answers (1)
Sukrut Tamhankar
on 20 Nov 2020
0 votes
As per my understanding, you are expecting to edit excel file from the MATLAB directly. Please refer the following example which shows how to use a COM Automation server to access another application from MATLAB. It creates a user interface to access the data in a Microsoft Excel file:
This technique can help you to edit data in the excel file and save it back to the file through MATLAB.
You can find the answer to the similar query in the following MATLAB Answer link in which the same technique is used :
Categories
Find more on Spreadsheets in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


