How to select every 11th element in a vector?

1 回表示 (過去 30 日間)
Daniel Tanner
Daniel Tanner 2020 年 2 月 11 日
コメント済み: Daniel Tanner 2020 年 2 月 11 日
Hi, I have a column vector M with dimensions 121-by-1. Is there a way to select every 11th element in there to arrive at 11 new 11-by-1 vectors? Or even better, is it possible to collate these vectors after into a matrix of 11-by-11 dimension?
Any help is much appreciated, thank you!

採用された回答

Johannes Hougaard
Johannes Hougaard 2020 年 2 月 11 日
Hi Daniel
You should be able to do that using the 'reshape' function (see its help for further description).
output = reshape(M,11,11);
,,,or maybe output = reshape(in,11,11)';
should do the trick for you.
  1 件のコメント
Daniel Tanner
Daniel Tanner 2020 年 2 月 11 日
Thank you, this is perfect!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeResizing and Reshaping Matrices についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by