how to run principal component analysis in a 3D matrix
25 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hugo
el 21 de Feb. de 2022
Respondida: Image Analyst
el 22 de Feb. de 2022
Hi,
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?
Thank you,
Best regards,
0 comentarios
Respuesta aceptada
AndresVar
el 21 de Feb. de 2022
Editada: AndresVar
el 21 de Feb. de 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));
size(data2d)
so the columns become the new time dimension.
0 comentarios
Más respuestas (1)
Image Analyst
el 22 de Feb. de 2022
See my attached demo where I run it on a 3-D (true color) image. Adapt as needed.
0 comentarios
Ver también
Categorías
Más información sobre Dimensionality Reduction and Feature Extraction en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!