yes of course. Leading solution:
function b = matInc(a)
[b aa] = ndgrid(1:max(a), a);
b(b > aa) = 0;
end
regards,
598 Solvers
Return the first and last characters of a character array
3968 Solvers
Arrange vector in ascending order
628 Solvers
Matrix which contains the values of an other matrix A at the given locations.
214 Solvers
Create a vector whose elements depend on the previous element
405 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!