Hi Ajith,
The error you're encountering is due to memory limitations when trying to perform Singular Value Decomposition (SVD) on a large matrix using princomp. Since princomp is deprecated and you have a large dataset, it's better to use pca, which is more efficient and offers better handling of large datasets.
% Assume X is your data matrix with observations in rows and variables in columns
% In your case, X is 50x36033
% Perform PCA
[coeff, score, latent, tsquared, explained, mu] = pca(X, 'NumComponents', 50);
% score contains the reduced dimensions (50x50)
% coeff contains the principal component coefficients
% latent contains the eigenvalues
% tsquared contains Hotelling's T-squared statistic
% explained contains the percentage of total variance explained by each component
% mu contains the estimated mean of each variable
% Extract the reduced dimensions
red_dim = score; % This will be 50x50
% If you need to transform new data into the reduced space, use:
% new_data_transformed = (new_data - mu) * coeff(:, 1:50);
Using pca instead of princomp should help you perform PCA more efficiently on large datasets and reduce the dimensionality to the desired number of components.