MATLAB Answers

Assign multiple elements of one cell array to another

9 views (last 30 days)
Leo Simon
Leo Simon on 19 Oct 2020
Commented: Leo Simon on 19 Oct 2020
Suppose I have a cell array A as below and I'd like B{;,:,2} to duplicate A. How can I do this without running a double loop? Presumably using deal but the examples on the web that I've seen don't cover this kind of case.
A =
4x8 cell array
Columns 1 through 7
{1x101 double} {1x101 double} {1x101 double} {1x101 double} {1x101 double} {1x101 double} {1x101 double}
{1x101 double} {1x101 double} {1x101 double} {1x101 double} {1x101 double} {1x101 double} {1x101 double}
{1x101 double} {1x101 double} {1x101 double} {1x101 double} {1x101 double} {1x101 double} {1x101 double}
{1x101 double} {1x101 double} {1x101 double} {1x101 double} {1x101 double} {1x101 double} {1x101 double}
Column 8
{1x101 double}
{1x101 double}
{1x101 double}
{1x101 double}

More Answers (0)

Community Treasure Hunt

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

Start Hunting!