how to run principal component analysis in a 3D matrix
30 vues (au cours des 30 derniers jours)
I am trying to run principal component analysis, pca() function to a 3D matrix. It does not work and I think it only works with 2D matrixes. Is there any way to circunvent this limitation?
AndresVar le 21 Fév 2022
Modifié(e) : AndresVar le 21 Fév 2022
You can reshape the matrix to 2D and then when you get results convert it back to the orginal dimensions if needed
There tricky part is to choose how to reshape. But say 2 dimensions are data, and the third is time then
data3d = ones([2,2,3]);
data2d = reshape(data3d,,size(data3d,3));
so the columns become the new time dimension.