Matlab function solve number pattern

Risposte (1)

Doddy Kastanya
Doddy Kastanya il 12 Gen 2021

0 voti

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

Categorie

Scopri di più su MATLAB Coder in Centro assistenza e File Exchange

Prodotti

Richiesto:

il 10 Gen 2021

Risposto:

il 12 Gen 2021

Community Treasure Hunt

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

Start Hunting!

Translated by