Matrix indexing - Picking columns
이전 댓글 표시
So I trying to give an output a matrix which contains every fifth column of input (A). Below is what my current script look like.
function B = Script30( A )
B = A(:,1:5:end);
end
댓글 수: 5
Birdman
2018년 4월 15일
So, question?
bondpen
2018년 4월 15일
Guillaume
2018년 4월 15일
Important difference: your code is not a script but a function. It's begging for confusion to name a function script***.
Your function already returns every fifth column of the matrix, starting at column 1, so it's not clear what problem you're having
Jan
2018년 4월 16일
What give you rows? The shown code extracts columns.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!