Appending one cell array to non-zero cells of another
Ältere Kommentare anzeigen
I have a cell array FINAL_OUTPUT < 50x1 cell > and another one called indexing as shown in the attached file. How can I append the indexing column inside the non-empty cells of FINAL_OUTPUT? In the end, I would like to have FINAL_OUTPUT{1,1} having size 3x3 FINAL_OUTPUT{2,1} having size < 1x3 > etc...and the empty cells of FINAL_OUTPUT should remain empty.
3 Kommentare
You imply that each row of the index-element gets allocated to one row of the desired output cell array element... but what happens when the number of rows of the elements of FINAL _OUTPUT and index do not match, such as on lines 7, 11, 12, 14, 17, 22, 32, and 34?
Or do all rows receive a copy of the whole vector from index?
Please upload some sample data for us to use, it is hard to write code with nothing to test it on. You can use the paperclip button, and then press both Choose file and Attach file.
Eli Dim
am 2 Jul. 2015
Akzeptierte Antwort
Weitere Antworten (1)
Azzi Abdelmalek
am 2 Jul. 2015
out=cellfun(@(x,y) [x y],FINAL_OUTPU,indexing,'un',0)
1 Kommentar
Eli Dim
am 2 Jul. 2015
Kategorien
Mehr zu Matrix Indexing 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!