Gather specially vector satisfied the condition

I want to gather specially vector that satisfied the condition :
if
np=100;
x_1n = 1.5*randn(1,np); x_n = [x_1n; 0.5*(x_1n+randn(1,np))]; X = [x_1,...,x_100]
How can I put in 100 of vector in X in MATLAB? (like creating vector space?)

 採用された回答

KSSV
KSSV 2022 年 4 月 21 日

0 投票

np=100;
X = zeros(np) ;
x = 1.5*randn(np,1);
for i = 2:np
X(:,i) = 0.5*(X(:,i-1)+randn(np,1));
end

4 件のコメント

Yeachan Choi
Yeachan Choi 2022 年 4 月 21 日
x_n should be 2-dimension vector(or matrix) Thank you
KSSV
KSSV 2022 年 4 月 21 日
np=100;
X = zeros(2,np,np) ;
for i = 1:np
x_1n = 1.5*randn(1,np);
x_n = [x_1n; 0.5*(x_1n+randn(1,np))];
X(:,:,i) = x_n ;
end
Yeachan Choi
Yeachan Choi 2022 年 4 月 21 日
hmm.. I should print about cov(X)....
Yeachan Choi
Yeachan Choi 2022 年 4 月 21 日
And I think It's right your first answer, because I can see in matlab that x_n is 2*100, and X is 100*100 thank you very much.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeTime Series についてさらに検索

質問済み:

2022 年 4 月 21 日

コメント済み:

2022 年 4 月 21 日

Community Treasure Hunt

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

Start Hunting!

Translated by