Clear Filters
Clear Filters

replicating/copy part of Cell Array

70 views (last 30 days)
I have Cell Array;
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.

Accepted Answer

Daniel Shub
Daniel Shub on 29 Nov 2011
What about ...
NewCA = CA(1:50, 4:5);
Not the use of () and not {}.
  1 Comment
Scragmore on 29 Nov 2011
I was {} fixated, "its cell array so must use {}".
wood for trees and all that.

Sign in to comment.

More Answers (1)

Astik Sachan
Astik Sachan on 10 May 2017
Edited: Astik Sachan on 10 May 2017
CA{100,5}; %you have
tempCA = {CA{1:50,4:5}};
NewCA = reshape(tempCA,[50,2]);
Try this!


Find more on Genomics and Next Generation Sequencing in Help Center and File Exchange


Community Treasure Hunt

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

Start Hunting!