Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

xlsread, biffparse, compatibility problem of windows and mac

33 views
Skip to first unread message

Ramazan

unread,
Jul 16, 2010, 11:13:06 AM7/16/10
to
Hi, all,

I am using a Matlab2009b and I have a working code of...

[input_file,pathname] = uigetfile( ...
{'*.xls', 'Excel Files (*.xls)'; ... % Recomended file type is xls
'*.xlsx', 'Excel 2009 Files (*.xlsx)'; ...
'*.*', 'All Files (*.*)'}, ...
'Select files', ...
'MultiSelect', 'off'); % User can only select single file at a time

% if file selection is cancelled, pathname should be zero
% and 'File not found' will be displayed
% otherwise 'File name will be displayed'
if isequal(input_file,0)||isequal(pathname,0)
disp('File not found')
else
disp(['File ', pathname, input_file, ' found'])
end

% input_file will be parsed into two matrix
% numData includes numerical data
% txtData includes Header and Row data names
[numData,txtData]= xlsread(input_file);

However, when my supervisor runs this code he gets an error of
"biffparse" error and says invalid record error.

my supervisor has Mac computer with matlab2010 version?

What is the problem and how can I fix this problem.

Thanks in advance,

Bruce

unread,
Jul 19, 2010, 6:15:06 PM7/19/10
to
"Ramazan " <perky...@aol.com> wrote in message <i1psu2$2ce$1...@fred.mathworks.com>...

Hello Ramazan,

I found this solution on MW website which may account for your supervisor's
"biffparse" error. Please note the 'break' statement is missing in a vital part of your code too (as I describe below the MW solution).

"... Thus XLSWRITE as well as XLSREAD have limited functionality on the Mac platform.
...
Support for XLSREAD on Mac OS X may be considered for a future release of MATLAB. Unfortunately, there are no workarounds for the issue at this time."
(ref: http://www.mathworks.com/support/solutions/en/data/1-2SJUON/index.html?solution=1-2SJUON)
************************************************
BUT, also note you need to insert a 'break' statement in your code like so:
...
if isequal(input_file,0)||isequal(pathname,0)
disp('File not found');
break % INSERT HERE
else
...

If you don't do this then you get these error messages:
************************************************
??? Error using ==> xlsread at 122
Filename must be a string.

Error in ==> uiretrieve at 22
[numData,txtData]= xlsread(input_file);
************************************************

Cheers,

Bruce

Ramazan

unread,
Jul 23, 2010, 9:59:05 AM7/23/10
to
Hi Bruce

I did not know that, Great catch :) , thanks for your time,

Take care

0 new messages