For Loop for storing data
조회 수: 16 (최근 30일)
이전 댓글 표시
How would I write a for loop to extract columns from a large matrix and put it into a new matrix. For example, I want to take every 6th column of my very large matrix and store it in a new matrix.
Thanks!
댓글 수: 0
답변 (1개)
James Tursa
2016년 11월 12일
편집: James Tursa
2016년 11월 12일
No loop needed:
a = your very large matrix
b = a(:,1:6:end); % every 6th column, starting with 1st column
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!