Dimensions of arrays being concatenated are not consistent.
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I need to concatenate arrays that have variable length. All have 1 row but the number of columns are changing. Any suggestion?
Total_No_cells_r=[Total_No_cells_r;(total_cellcount_r)'];
3 Kommentare
Antworten (2)
James Tursa
am 2 Okt. 2019
If they are all row vectors, then I would think something like this:
Total_No_cells_r = [Total_No_cells_r, total_cellcount_r];
If not, then you need to tell us what the sizes actually are.
Star Strider
am 2 Okt. 2019
Bearbeitet: Star Strider
am 2 Okt. 2019
If they all have one row and you want to concatenate them, the only certain way is to use the horzcat function.
EDIT —
For example, since ‘radius’ appears to be incrementing with a constant interval (and so can be used as an index counter):
Total_No_cells_r{radius} = [radius, total_cellcount_r(1), (total_cellcount_r(2), ...];
That would accommodate any number of columns in each row.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!