Matlab function solve number pattern
5 次查看(过去 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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Ordinary Differential Equations 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!