How combine two cell arrays matlab

6 vues (au cours des 30 derniers jours)
Igor Serafin
Igor Serafin le 8 Mai 2019
Commenté : Igor Serafin le 8 Mai 2019
Hi, i want to combine two Cell array:
C =
4×2 cell array
{[0]} {[1]}
{[0]} {[1]}
{[0]} {[1]}
{[0]} {[1]}
D =
4×2 cell array
{[1]} {[1]}
{[2]} {[2]}
{[3]} {[3]}
{[4]} {[4]}
I would like to get the following Cell array:
E =
4×2 cell array
{[0 1]} {[1 1]}
{[0 2]} {[1 2]}
{[0 3]} {[1 3]}
{[0 4]} {[1 4]}
How can I do this? Thanks

Réponse acceptée

James Tursa
James Tursa le 8 Mai 2019
E = cellfun(@(x,y)[x y],C,D,'uni',false);

Plus de réponses (0)

Catégories

En savoir plus sur Data Types dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by