what this colon mean in this code
조회 수: 1 (최근 30일)
이전 댓글 표시
buf(:,:) = abs(p(:,1,:)); norm_buf=buf./max(max(buf));
i have this code as a part of program but i did not get what is mean
댓글 수: 0
채택된 답변
Star Strider
2017년 4월 27일
The colons here mean all the elements in that particular ‘page’ of the matrix. See the documentation for colon,: (link) for the details.
댓글 수: 2
Star Strider
2017년 4월 27일
I will do my best.
For example if ‘p’ is a (2x3x4) matrix, ‘p(:,1,:)’ is the same as: ‘p(1:2,1,1:4)’.
Writing ‘p(:,1,:)’ is easier, especially if the size of ‘p’ changes either within a particular script, or between different runs of the script or calls to a function.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Matrices and Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!