error using xlsread command in matlab

I have written in my matlab program:
EnergyfromSun = xlsread('C:\Homa\Thesis\Matlab\SC\ASTMG173num.xls'); but I got this message:
??? No appropriate method, property, or field UsedRange for class Interface.Microsoft_Excel_14.0_Object_Library._Chart.
Error in ==> xlsread at 302 DataRange = Excel.ActiveSheet.UsedRange;
Error in ==> T2011 at 10 EnergyfromSun = xlsread('C:\Homa\Thesis\Matlab\SC\ASTMG173num.xls');
>> This excel sheet has 2 columns and 2002 rows and I am using matlab 7.11.0 version Please help me, I am too confused. Thanks Homa

댓글 수: 4

Lalit Patil
Lalit Patil 2012년 11월 27일
Try this.
EnergyfromSun = xlsread('C:\Homa\Thesis\Matlab\SC\ASTMG173num.xlsx');
or
EnergyfromSun = xlsread('C:/Homa/Thesis/Matlab/SC/ASTMG173num.xls');
Jan
Jan 2012년 11월 27일
@Lalit: I do not assume, that the filename is wrong. Using the backslash is valid under Windows.
Walter Roberson
Walter Roberson 2012년 11월 27일
Is there a chart in the .xls file? Is there anything other than plain data?
Homa
Homa 2012년 11월 27일
@ Walter yes there is a chart!! Thanks a lot

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

 채택된 답변

Walter Roberson
Walter Roberson 2012년 11월 27일

1 개 추천

The error message is complaining that UsedRange does not apply to charts. I do not know enough about Excel to know what the solution is, other than to delete the chart. Possibly if you specify the range of rows/columns that might solve the problem.

추가 답변 (0개)

카테고리

태그

질문:

2012년 11월 27일

Community Treasure Hunt

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

Start Hunting!

Translated by