Identical issue has been discussed a number of times here. In particular, I recommend Why column major?, in which you can find a few useful explanations. Perhaps my take Why column major? - #36 by zdenek_hurak could be one of them.
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| `for i = 1:M, j = 1:N` discrepancy (loop vs comprehension/generator) | 26 | 4415 | December 28, 2022 | |
| Why column major? | 59 | 20386 | February 17, 2024 | |
| Nested loop confusion | 3 | 564 | December 1, 2022 | |
| Comprehensions and vectorization | 13 | 5105 | September 20, 2017 | |
| Documentation for comprehensions with if and/or w/o comma | 3 | 602 | April 17, 2019 |