From: enviro on
Hi there;

I would like to read multiple excel sheets and save each sheet as separate matrix. I have tried below but there is a problem yet. Any help would be appreciated.

%--------------------------
[type,sheetname] = xlsfinfo('test.xls');
m=size(sheetname,2);

for(i=1:1:m);
Sheet = char(sheetname(1,i)) ;
matrix = xlsread('test', 'Sheet');
end
From: Giacomo Faggiani on

> matrix = xlsread('test', 'Sheet');

matrix = xlsread('test', Sheet);

try without marks

Giacomo
From: enviro on
Thanks for your reply.
It now gives only final sheet. I wonder if I could have all sheets and a way to save them into individual matrices.
From: Leslie McBrayer on

"enviro" <farhadnejadkoorki(a)yahoo.co.uk> wrote in message
news:1789462907.86588.1256041993772.JavaMail.root(a)gallium.mathforum.org...
> Thanks for your reply.
> It now gives only final sheet. I wonder if I could have all sheets and a
> way to save them into individual matrices.

You could create a cell array as follows:

alldata = cell(1, m);

for(i=1:1:m);
Sheet = char(sheetname(1,i)) ;
alldata{i} = xlsread('test', Sheet);
end


From: enviro on
Thanks for the help