Matlab function solve number pattern

2 Ansichten (letzte 30 Tage)
amir zmn
amir zmn am 10 Jan. 2021
Beantwortet: Doddy Kastanya am 12 Jan. 2021
Please some one help me in this number pattern How to write this code?

Antworten (1)

Doddy Kastanya
Doddy Kastanya am 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

Kategorien

Mehr zu MATLAB Coder finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by