I have a linspace vector in matlab, a vector of eigenvalues and a matrix of its corresponding eigenvectors which I’ve obtained from the eig command.
I histogram the eigenvalues using hist(eigenvalues,linspace).
I would like to sum up all the eigenvectors corresponding to each histogram bin.
For example, bin 1 contains eigenvalues w_1, w_2, w_3, w_4. I would like to find v_bin1 = v_1 + v_2 + v_3 + v_4 where v_1, v_2, v_3, v_4 are corresponding eigenvalues for eigenvectors w_1, w_2, w_3, w_4 respectively.
How would one go about doing this, keeping vectorization in mind?
Say you have N eigenvalues, and the corresponding eigenvector matrix is V (where the columns are the eigenvectors), you need to create a matrix A such that:
The result of A*V’ will be a matrix where each row is the sum of eigenvectors you are looking for.
I’ll leave it to you to determine how to construct the matrix A from the
linspacevector you have. This may require a simple loop.