Matlab function solve number pattern
조회 수: 2 (최근 30일)
이전 댓글 표시
Please some one help me in this number pattern How to write this code?
답변 (1개)
Doddy Kastanya
2021년 1월 12일
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
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!