Matrix Fill with same number sequence

How can I fill a matrix with the same sequence of numbers?
I want a matrix in which the first row contains 20 and 30. this should then also be in the next five rows.

 Akzeptierte Antwort

Walter Roberson
Walter Roberson am 20 Apr. 2021

0 Stimmen

YourMatrix(1:6,1:2:end) = 20;
YourMatrix(1:6,2:2:end) = 30;

2 Kommentare

Thank you an how could i fill a matrix that it looks like this?
20 20 20 20 20
30 30 30 30 30
YourMatrix(1,1:5) = 20;
YourMatrix(2,:) = 30;

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Hilfe-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