I have Cell Array;
CA{100,5}
is there a function/syntax to copy a section of a cell array in a similar fashion to copying a matrix;
NewCA = CA{1:50, 4:5};
or do I have to cell copy using a loop.
Thanks,
AD

 Akzeptierte Antwort

Daniel Shub
Daniel Shub am 29 Nov. 2011

5 Stimmen

What about ...
NewCA = CA(1:50, 4:5);
Not the use of () and not {}.

1 Kommentar

Scragmore
Scragmore am 29 Nov. 2011
Thanks,
I was {} fixated, "its cell array so must use {}".
wood for trees and all that.
AD

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Astik Sachan
Astik Sachan am 10 Mai 2017
Bearbeitet: Astik Sachan am 10 Mai 2017

1 Stimme

CA{100,5}; %you have
tempCA = {CA{1:50,4:5}};
NewCA = reshape(tempCA,[50,2]);
Try this!

Kategorien

Mehr zu Data Types finden Sie in Hilfe-Center und File Exchange

Produkte

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by