filling matrix in matlab code

76 Ansichten (letzte 30 Tage)
marwa hajji
marwa hajji am 12 Okt. 2021
Bearbeitet: marwa hajji am 13 Okt. 2021
how to filling matrix in matlab
  1 Kommentar
Jan
Jan am 12 Okt. 2021
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?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Kevin Holly
Kevin Holly am 12 Okt. 2021
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

Kategorien

Mehr zu Loops and Conditional Statements finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by