How to fill a matrix with formula
4 ビュー (過去 30 日間)
古いコメントを表示
I want my output matrix to be a 4x5 matrix but you have given a 5x4 matrix as output.
y=zeros(1,20);
y(1)=0.7;
for i=2:20
y(i)=1.3*y(i-1)*(1-y(i-1));
end
y=reshape(y,[4,5]);
disp(y)
But my desired matrix:
y_answer =
0.7000 0.2730 0.2580 0.2489 0.2430
0.2391 0.2365 0.2348 0.2335 0.2327
0.2321 0.2317 0.2314 0.2312 0.2311
0.2310 0.2309 0.2309 0.2308 0.2308
I want to give y_answer as output.
In other words, from the first member to the fifth member of the y matrix, fill in the first row of the matrix and also the next rows of the matrix.
Can the code be changed to print the y_answer matrix in the output?
0 件のコメント
採用された回答
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Dynamic System Models についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!