It is worth noting that concatenating matrices like this makes a copy, and thus is not a good idea for large amounts of data, or in performance sensitive inner loops. If you are concatenating vectors to a matrix many times in a loop, using an Array-of-Arrays is sometimes a better option.
avik
4
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| Adding a line to the end of an Array | 8 | 935 | June 30, 2020 | |
| How does one add rows to a Julia array? | 6 | 22190 | July 4, 2020 | |
| Adding rows to a matrix dynamically | 4 | 3551 | January 7, 2021 | |
| Using push! to add a new row of data | 13 | 1324 | August 31, 2022 | |
| Add row to 2D array in a loop | 2 | 1563 | October 26, 2020 |