Matlab function solve number pattern

Respuestas (1)

Doddy Kastanya
Doddy Kastanya el 12 de En. de 2021

0 votos

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

Categorías

Más información sobre MATLAB Coder en Centro de ayuda y File Exchange.

Productos

Preguntada:

el 10 de En. de 2021

Respondida:

el 12 de En. de 2021

Community Treasure Hunt

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

Start Hunting!

Translated by