filling matrix in matlab code

66 次查看(过去 30 天)
marwa hajji
marwa hajji 2021-10-12
编辑: marwa hajji 2021-10-13
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
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

类别

Help CenterFile Exchange 中查找有关 Loops and Conditional Statements 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by