How to Create an ID Matrix without Eyes and Loops
I'm just wondering if it is possible to create a single matrix without the eye function, loop and any matlab build function. At first I thought to use something like this:
A = bsxfun(@power, 1:n, (1:n).');
Unfortunately I don't think I can assign the values '1' and '0' without using some kind of loop. and this still uses the build function. any idea?
+3
source to share
3 answers