To create a matrix of 3 vectors that all have norm 1 in Matlab, we can use the random function to generate random vectors and then normalize them using the norm function. Here is an example code:
main.m408 chars24 lines
In this code, we first define the dimension of the vectors (n=3). Then we use the rand function to create three random vectors of size nx1 (v1, v2, and v3). We then normalize each vector using the norm function and store them back in their original variables. Finally, we combine the vectors into a matrix M and display the matrix along with the norms of its vectors.
gistlibby LogSnag