Why can't I use mapcaplot?

1 vue (au cours des 30 derniers jours)
Ruth Pikovsky
Ruth Pikovsky le 9 Sep 2021
Commenté : Ruth Pikovsky le 10 Sep 2021
Hello,
I'm trying to preform PCA analysis for a set of values that I get from the attached excel.
I need to preform the analysis on all 40 variables.
clc
clear all
close all
x=readtable('PCA table.xlsx');
x=table2array(x);
mapcaplot(x)
When I try to use mapcaplot I get the following error:
Index in position 2 exceeds array bounds (must not exceed 1).
Error in mapcaplot>localUpdateBrushPlots (line 201)
ydata = data(:,INDEX_DIM2);
Error in mapcaplot>localInit (line 178)
localUpdateBrushPlots(fig);
Error in mapcaplot (line 65)
localInit(fig,varargin{:});
Error in Untitled (line 7)
mapcaplot(x)
I would appreciate some help. I've never tried to do PCA before and I'm not sure what exactly the function needs as input.
Thank you,
Ruth
  1 commentaire
Star Strider
Star Strider le 9 Sep 2021
If you use the rmmissing funciton on ‘x’, only two rows of valid data remain.

Connectez-vous pour commenter.

Réponse acceptée

Adam Danz
Adam Danz le 9 Sep 2021
See the documentation.
The data input should be a numeric array or a DataMatrix object. Yours is a table.
Also see table2array.
  5 commentaires
Adam Danz
Adam Danz le 9 Sep 2021
That will likely affect the pca results, though. Try interpolation if that makes sense for the data.
Ruth Pikovsky
Ruth Pikovsky le 10 Sep 2021
Yeah that's also a good idea. Thank you.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Dimensionality Reduction and Feature Extraction dans Help Center et File Exchange

Tags

Produits


Version

R2020a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by