Matlab function solve number pattern
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Please some one help me in this number pattern How to write this code?
Réponses (1)
Doddy Kastanya
le 12 Jan 2021
The following code listing should do it (ignore the zeros in the output):
cnt=0;
for i=1:5
for j=1:i
cnt=cnt+1;
y(i,j)=cnt;
if cnt==12
break
end
end
end
y
0 commentaires
Voir également
Catégories
En savoir plus sur Matrices and Arrays dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!