filling matrix in matlab code

조회 수: 71 (최근 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