yes of course. Leading solution:
function b = matInc(a)
[b aa] = ndgrid(1:max(a), a);
b(b > aa) = 0;
end
regards,
Find common elements in matrix rows
1277 Solvers
Read a column of numbers and interpolate missing data
1255 Solvers
Back to basics 16 - byte order
173 Solvers
399 Solvers
371 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!