dpb
Posts:
6,853
Registered:
6/7/07
|
|
Re: 'index exceeds matrix dimensions' using text function with bar
Posted:
Jan 31, 2013 10:21 AM
|
|
On 1/30/2013 1:30 PM, dpb wrote: ...
> >> stats={[A' B]} > stats = > [5x3 double] > >> y=cell2mat(stats(:,[2 3])); > Index exceeds matrix dimensions. ...
> The problem is you can't subreference the array contents from the cell > that way because the dimensions refer to the cell _array_ dimensions, > not those of the data _in_ the cell. ...
And, BTW, what you're looking for is handled by 'multi-level addressing'--you can do w/o the cell2mat() and access the data directly by writing
y=stats{1}(:,[2 3]);
Note the curlies are on the cell to dereference, then the normal parens around the content to select them elements.
There's a whole section in the doc on referencing cell contents directly...
--
|
|