clearvars close all clc load data_pca.mat %% X=data(:,2:end); X_zscore=zscore(X); [coeff,score,latent,tsquared,explained] = pca(X_zscore); % score = componente principale % coeff = coefficienti di caratterizzazione Xcentered = score*coeff'; figure, subplot(211), imagesc(X_zscore), subplot(212), imagesc(Xcentered) figure, subplot(211), plot(latent,'o'), title('autovalori'), subplot(212), plot(explained,'ro'), title('autovalori %') %% figure() pareto(explained) xlabel('Principal Component') ylabel('Variance Explained (%)') %% figure, imagesc(score), colormap 'jet' figure, imagesc(abs(coeff)), colormap 'jet'