How to prevent cell array within cell array
Ältere Kommentare anzeigen
Dear Experts
I have two cell arrays. One cell array is a combination of another cell array.
name = { 'Tom', 'Tim'};
record = {'school', 'class', name};
Output becomes nested cell arrays. Desired Output:
record = {'school', 'class', 'Tom', 'Tim'}
Thank you for your help
1 Kommentar
>> record = [{'school', 'class'}, name]
record =
'school' 'class' 'Tom' 'Tim'
Akzeptierte Antwort
Weitere Antworten (2)
Andrei Bobrov
am 19 Jul. 2016
record = {'school', 'class', name{:}}
Star Strider
am 19 Jul. 2016
This works:
name = { 'Tom', 'Tim'};
record = {'school', 'class', name};
record2 = {record{1:2}, record{3}{1:2}};
record2 =
'school' 'class' 'Tom' 'Tim'
Kategorien
Mehr zu Cell Arrays finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!