n = 3;
A(1,1:n+1) = 0;
for i = 2 : n+1
A(i,1:i-1) = A(i-1, 1:i-1) +1;
end
for i = 1: n+1
B(i,1:i) = (n+1-i);
end
C(1,n+1) = 0;
for i = 2 : n+1
C(i,:) = C(i-1,:);
C(i,i) = C(i,i-1)+1;
end
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!