|
dpb <none@non.net> wrote in message <jrdc3f$ld2$2@speranza.aioe.org>...
> On 6/14/2012 12:31 PM, Jerry wrote:
> > Hello,
> >
> > "S" is a Simdata or a structure data. The size of "S" is (1x98). Under
> > each subset of S={S1, S2,...S98}, there is a data={d1, d2,...d98}, in
> > that the size of the data is not the same, see below:
> >
> > d1 <177x100 double>
> > d2 <191x100 double>
> > ..
> > ..
> > d98 <103x100 double>
> >
> >>> R = size(S,2);
> > for i=1:R
> > D {i}=S (i).Data ; %#ok<SAGROW>
> > end
> >>> Data=cell2mat (D);
> >
> > I need to create the "Data". Since the size of {d1, d2,...d98} are not
> > the same, I got following error:
> >
> > ??? Error using ==> cat
> > CAT arguments dimensions are not consistent.
> > Error in ==> cell2mat at 81
> > m{n} = cat(2,c{n,:});
> >
> > How may I fix this problem?
>
> Don't you want
>
> cat(1,S(i).Data)
>
> ???
>
> --
OK, I changed the loop in this way,
for i=1:NumResult
D {i}=cat(1,S(i).Data); %#ok<SAGROW>
end
I still got this error, see:
??? Error using ==> cat
CAT arguments dimensions are not consistent.
Error in ==> cell2mat at 81
m{n} = cat(2,c{n,:});
Thanks,
Jerry
|