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 | 4388 | December 28, 2022 | |
| Why column major? | 59 | 20330 | February 17, 2024 | |
| Nested loop confusion | 3 | 559 | December 1, 2022 | |
| Comprehensions and vectorization | 13 | 5100 | September 20, 2017 | |
| Documentation for comprehensions with if and/or w/o comma | 3 | 600 | April 17, 2019 |