필터 지우기
필터 지우기

Problems with xlsread function

조회 수: 1 (최근 30일)
Ed
Ed 2012년 12월 21일
I am using Matlab R2012a.
I do the following example from your documentation:
values = {1, 2, 3 ; 4, 5, 'x' ; 7, 8, 9}
headers = {'First', 'Second', 'Third'}
xlswrite('myExample.xlsx', [headers; values]);
This creates an excel file no problem which I can open in excel.
When I do:
A = xlsread('myExample.xlsx')
I get the following error messages:
Error: Object returned error code: 0x800AC472
Error in xlsreadCOM (line 2)
Excel.DisplayAlerts = 0;
Error in xlsread (line 230)
[numericData, textData, rawData, customOutput] = xlsreadCOM(file, sheet,
range, Excel, customFun);
What is going on?

답변 (1개)

Jonathan Sullivan
Jonathan Sullivan 2012년 12월 21일
I can't seem to recreate the problem. Try clearing and closing everything:
values = {1, 2, 3 ; 4, 5, 'x' ; 7, 8, 9}
headers = {'First', 'Second', 'Third'}
xlswrite('myExample.xlsx', [headers; values]);
clear all; close all
xlsread('myExample.xlsx')
  댓글 수: 2
Ed
Ed 2012년 12월 21일
clearing and closing did not make any difference.
Image Analyst
Image Analyst 2012년 12월 21일
Is your version of Excel modern enough to read .xlsx files? Sounds like it. What version is it? What happens if you ask for all 3 outputs that xlsread can return?

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

카테고리

Help CenterFile Exchange에서 Data Import from MATLAB에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by