Two identical commands take different times to run?
이전 댓글 표시
I am running this function inside a bigger script:

K11 and K12 are just the same Matrix at start. I have two questions now:
- Why is line 11 taking much more than 9? It is the exact same command
- Why removing columns is much easier than removing rows?
채택된 답변
추가 답변 (1개)
Marta Salas
2014년 3월 5일
0 개 추천
When you create a 2D array, you need to reference each element to its memory address. As a result, for a 2D array, you need to allocate MxN elements in memory (where M is the number of rows and N of columns). Since memory is a linear object, you need to choose how you organize these elements. You have two options “Row major order” or “Column major order”. Matlab choses the Column major order option.
카테고리
도움말 센터 및 File Exchange에서 Performance and Memory에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
