Info

此问题已关闭。 请重新打开它进行编辑或回答。

Write a function called bell that returns the first n rows of the Bell triangle, where n is an input argument.The function must return an n-by-n array where the top left triangle contains the Bell triangle with each row of the Bell triangle positione

2 次查看(过去 30 天)
n = 7;
a = zeros(n);
a(1) = 1;
for k = 1:n-1
a(k+1,1:k+1) = cumsum(a(k,[k,1:k]),2);
end

回答(0 个)

此问题已关闭。

标签

Community Treasure Hunt

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

Start Hunting!

Translated by