Clear Filters
Clear Filters

pca coeff,scores, explained for several matrices in a for loop

1 view (last 30 days)
Hy everybody,
I have the following issue: i want to get the coeff, scores and explained values for all my 17 submatrices using the following loop.
How do i have to assign the variables coeff, score, explained in advance in the code that it gives me not 1 but 17 outputs?
for j=1:17 %number of my matrices
[coeff,score,~,~,explained] = pca({1, j});
my matrices have the size (15,221).
Thanks for help!
  1 Comment
Kim Arnold
Kim Arnold on 20 Feb 2020
Hi found out myself.
for j=1:length(Spos.Submatrices.tpoints)
[coeff{1,j},score{1,j},~,~,explained{1,j}] = pca({1, j});

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!