yes of course. Leading solution:
function b = matInc(a)
[b aa] = ndgrid(1:max(a), a);
b(b > aa) = 0;
end
regards,
57898 Solvers
Magic is simple (for beginners)
3226 Solvers
Given a matrix, swap the 2nd & 3rd columns
546 Solvers
193 Solvers
343 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!