unable read any ".xlsx" or ".xls" data

조회 수: 2 (최근 30일)
Yu Jui Huang
Yu Jui Huang 2020년 11월 17일
답변: Sukrut Tamhankar 2020년 11월 20일
它無法讀取任何“ .xlsx”或“ .xls”數據。它甚至沒有報告命令窗口中的任何錯誤,而是當我雙擊其中任何一個時發出的簡單聲音。我使用win10,MATLAB2020b,office 2013。
我已經從MATLAB獲得了所有工具箱。並且Excel可以正常工作。這些“ .xlsx / .xls”可以“在matlab外部打開”,並且在以下情況下可以使用:
readtable('path_to.xlsx','Sheet','sheet_name')
如果我不僅要在命令窗口中打開表,而且要直接在MATLAB中打開“ .xlsx / .xls”,該如何解決?
  댓글 수: 10
Yu Jui Huang
Yu Jui Huang 2020년 11월 18일
It is OK with ".csv".
I need to import "xls/xlsx" like that but it can't. It is unable to read (or import) like the form of excel in MATLAB, without any message of error.
Rik
Rik 2020년 11월 18일
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.

댓글을 달려면 로그인하십시오.

답변 (1개)

Sukrut Tamhankar
Sukrut Tamhankar 2020년 11월 20일
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 :
Whereas, Import tool or import functions enable you to read the data from excel file in the MATLAB.

카테고리

Help CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by