filling matrix in matlab code

how to filling matrix in matlab

1 件のコメント

Jan
Jan 2021 年 10 月 12 日
I have a loop in my matlab program which gives me 10 successive values as results, and I want to fill these values in a row matrix of size [10]. how do I program the filling of these values in the matrix in matlab?

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

回答 (1 件)

Kevin Holly
Kevin Holly 2021 年 10 月 12 日

0 投票

matrice = zeros(10);
for i=1:10
matrice(1,i)=i;
end
matrice
matrice = 10×10
1 2 3 4 5 6 7 8 9 10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

カテゴリ

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

質問済み:

2021 年 10 月 12 日

編集済み:

2021 年 10 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by