Adding elements of double arrays inside cell array below another double array inside the same cell array
Mostra commenti meno recenti
Hello!!!!! I have a problem on dealing with cell array. I would like to ask for some help. So, my problem is that I have on cell array. Inside this cell array, there are a lot of double arrays in each cell element. The thing is that I would like to put double arrays (inside this cell) below another double array. Here are my example in file attached. "Example.mat" contains the cell array named as "Sort". and "Solution.mat" contains solutions of double array I would like to have. Sometimes, I would like to have solution as A1 array which is the solution of adding three arrays together. Another time I may want to have solution of adding two array together as shown in A4.
Here are how A1, A2, A3 are derived.
A1=[Sort{1,1}; Sort{1,2}; Sort{1,3}];
A2=[Sort{2,1}; Sort{2,2}; Sort{2,3}];
A3=[Sort{3,1}; Sort{3,2}; Sort{3,3}];
A4=[Sort{3,1}; Sort{3,2}];
Note that this example is just a small part of my real cell arrays. The actual cell array is very huge and the difficult part is that I want to make it dynamically without doing in term of [Sort{1,1}; Sort{1,2}; .....; Sort{1,n}]; where n is the last column in cell array I would like to add double array in n cell to other array.
Thank you in advance.
1 Commento
Stephen23
il 23 Apr 2019
"Adding elements ..."
You are not "adding" those arrays, you are concatenating them:
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Shifting and Sorting Matrices in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!