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

조회 수: 1 (최근 30일)
Kim Arnold
Kim Arnold 2020년 2월 20일
댓글: Kim Arnold 2020년 2월 20일
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(S.Submatrices.tp{1, j});
end
my matrices have the size (15,221).
Thanks for help!
  댓글 수: 1
Kim Arnold
Kim Arnold 2020년 2월 20일
Hi found out myself.
coeff=cell(1,17);
score=cell(1,17);
explained=cell(1,17);
for j=1:length(Spos.Submatrices.tpoints)
[coeff{1,j},score{1,j},~,~,explained{1,j}] = pca(Spos.Submatrices.tp{1, j});
end

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Dimensionality Reduction and Feature Extraction에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by