yes of course. Leading solution:
function b = matInc(a)
[b aa] = ndgrid(1:max(a), a);
b(b > aa) = 0;
end
regards,
654 Solvers
Make one big string out of two smaller strings
1151 Solvers
309 Solvers
Matrix indexing with two vectors of indices
487 Solvers
Getting the absolute index from a matrix
211 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!