Creating a matrix using the for loop function
Afficher commentaires plus anciens
How would I create this matrix
X= 1/2
0
0
0
0
0
0
0
0
0
In this case n=10. Is there a way to make this matrix where n=100, where the first entry is 1/2 and the rest are zeros
Réponses (1)
Stephen23
le 23 Fév 2018
Or in one line:
[1/2;zeros(n-1,1)]
Catégories
En savoir plus sur Loops and Conditional Statements dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!