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!