From: niculao nuele on
hi to everyone!
I'm new user, I hope some one help me:

this is a normal structure of xlsread

x= xlsread('dati.xls', 'LUBA_A' ,'B2:B32')

but I would use it in for structure
in which read every time a different culumn

so I wrote :
for k=1:4
x(k)= xlsread('dati.xls', 'LUBA_A' ,p(k))
end

in which p= ('B2:B32','c2:C32','D2:D32','E2:E32' )

but don't work.

but I think that could be possible becouse if I use this script it work
p=['B2:B32']
x= xlsread('dati.xls', 'LUBA_A' ,p)

now I think could be a sintax error but I didn't find somethink like that


thanks a lot for your help
From: ImageAnalyst on
Possibly because x needs to be a cell array. What happens if you use
x{k} in your loop instead of x(k)? Each cell of x would in turn be a
cell array I think.

By the way, that will be very very slow because you will have to
launch Excel, extract numbers, and completely shutdown Excel 4 times.
You might want to do it via an activeX server.
From: niculao nuele on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <1fdd166e-4617-4fe8-9094-ced311d0e8ef(a)w3g2000vbw.googlegroups.com>...
> Possibly because x needs to be a cell array. What happens if you use
> x{k} in your loop instead of x(k)? Each cell of x would in turn be a
> cell array I think.
>
> By the way, that will be very very slow because you will have to
> launch Excel, extract numbers, and completely shutdown Excel 4 times.
> You might want to do it via an activeX server.

I'm sorry my question was not clear
my problem is use p(k) in

for k=1:4
x= xlsread('dati.xls', 'LUBA_A' ,p(k))
end

in which the help wont the excell range cell from take date like:
'B2:B10'

but in p I write p= ('B2:B32','c2:C32','D2:D32','E2:E32' )

for k=1:4
x= xlsread('dati.xls', 'LUBA_A' ,p(k))
....
end



so every time it copy a different column
but p(k) don't work

and I don't understud why
From: ImageAnalyst on
I believe Excel likes ranges in the form "A1..B10" not "A1:B10" Excel
uses dot dot while MATLAB uses the colon.
From: niculao nuele on
ImageAnalyst <imageanalyst(a)mailinator.com> wrote in message <f8cf6d8e-edf8-4f03-876b-0463d9f6bd5c(a)z7g2000yqb.googlegroups.com>...
> I believe Excel likes ranges in the form "A1..B10" not "A1:B10" Excel
> uses dot dot while MATLAB uses the colon.
it work:
x= xlsread('dati.xls', 'LUBA_A' ,'B2:B32')


the problem is the cycle for

for k=1:4
x= xlsread('dati.xls', 'LUBA_A' ,p(k))
end

I think the prblem is the syntax