It seems to be easy, but I'm not an expert, and google doesn't help.
I would like Matlab to have an elegant way to create standard ordered basis vectors for n-dimensional space. For example, the behavior is similar to the following:
>> [e1, e2] = SOB(2);
>> e1
e1 = 1 0
>> e2
e2 = 0 1
I hope for a 1-liner and don't want to write a function for something so simple.
thank
source
share