Is it at all possible to use the 'range' option in xlsread in Matlab 2012a on a Mac?

조회 수: 8 (최근 30일)
Arne
Arne 2012년 8월 31일
댓글: Alec Jacobson 2021년 1월 17일
Hi,
I recently changed from Windows to a Mac-system and I've been trying to somehow import data from an excel file while using the 'range' option in xlsread. I'm running Mountain Lion, Matlab 2012a for Mac and Excel for Mac 2011.
I found heaps of help on Matlab Central. A few workarounds were mentioned for this kind of problem. I tried the standard
[num,txt,raw] = xlsread('example_mac.xls',1,'C3:E5');
which resulted in
Warning: Range cannot be used in 'basic' mode. The entire sheet will be loaded.
> In xlsread at 199
and then I found a suggestion here
which suggested the command
A = dataset('XLSFile','example.xls','Sheet','T0NSW.1','Range','C2:E5');
which again resulted in this warning
Warning: Range cannot be used in 'basic' mode. The entire sheet will be loaded.
> In xlsread at 199
In dataset.readXLSFile at 14
In dataset.dataset>dataset.dataset at 344
I thought that the functionality of xlsread would be somewhat more general from 2012a onwards. I somehow understood that xlsread would available in the general mode and not just the basic mode, but I might have misunderstood that.
The xls-files I'm using are Excel 97-2003 files, I re-saved them all on the Mac system using Excel for Mac 2011.
The only question I have is:
Can I somehow import data from an Excel file while defining a specific range within the file?
Is there a workaround for this? If yes, a link to the solution would be sufficient. I looked for about a day now and I can't find a solution.
Thank you very much,
Arne
  댓글 수: 1
Alec Jacobson
Alec Jacobson 2021년 1월 17일
If others end up here, I managed to read ranges on mac by opening the .xls in Excell and exporting as .xlsx. xlsread seems to know how to read ranges of .xlsx files.

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

답변 (2개)

Walter Roberson
Walter Roberson 2012년 8월 31일
The range facility requires using ActiveX to talk to excel. That isn't possible on OS-X or Linux (or anything other than MS Windows) as ActiveX only exists on MS Windows.

Arne
Arne 2012년 8월 31일
Thank you Walter. Do you know of a clever workaround? -Arne

카테고리

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