フィルターのクリア

convert the values of a vector into a matrix and move the vector positions.

1 回表示 (過去 30 日間)
Valerie Cala
Valerie Cala 2018 年 10 月 26 日
コメント済み: Valerie Cala 2018 年 10 月 26 日
Hi, I need to do the following and I hope you can help me.
given a vector of (for example):
a=[3 9 32 6 5 6 7 1 2 10];
choose the first 5 positions upside down and 5 the next ones too but I must assign the value of position 6 to the next row of the matrix in position one, after that I need to see the resulting matrix, sorry for the bad explanation, to next I added an example of what I want to obtain
M= [5 6 32 9 3; 6 5 6 32 9; 7 6 5 6 32; 1 7 6 5 6 ... etc]
Thanks for reading and of course taking your time, I am not good enough in matlab but i I hope to impove my skills :D

採用された回答

Stephen23
Stephen23 2018 年 10 月 26 日
>> a = [3,9,32,6,5,6,7,1,2,10];
>> toeplitz(a(5:end),a(5:-1:1))
ans =
5 6 32 9 3
6 5 6 32 9
7 6 5 6 32
1 7 6 5 6
2 1 7 6 5
10 2 1 7 6
  2 件のコメント
Andrei Bobrov
Andrei Bobrov 2018 年 10 月 26 日
編集済み: Andrei Bobrov 2018 年 10 月 26 日
+1
also
rot90(hankel(a(1:5),a(5:end)),-1)
Valerie Cala
Valerie Cala 2018 年 10 月 26 日
Thank you so much guys it was easier than i thought, again thanks for your time

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by