Matlab function solve number pattern

Please some one help me in this number pattern How to write this code?

답변 (1개)

Doddy Kastanya
Doddy Kastanya 2021년 1월 12일

0 개 추천

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

카테고리

도움말 센터File Exchange에서 MATLAB Coder에 대해 자세히 알아보기

제품

질문:

2021년 1월 10일

답변:

2021년 1월 12일

Community Treasure Hunt

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

Start Hunting!

Translated by