how to do PCA for sequance alignment using 2018 version?

hi,
i tried to use the following fuction but it doesnot work!!.
and geting this error
Error using pca (line 168)
The value of X must be a numeric array.
[pc, zbscores, pcvars]= pca(ma);
variance_model=pcvars./sum(pcvars) * 100
cumsum_variance_model=cumsum(pcvars./sum(pcvars) * 100)

回答 (1 件)

Harsh
Harsh 2024 年 10 月 26 日

0 投票

Hi Khatab,
The error you are facing is because of the invalid datatype of “ma” variable in your code. The “pca” function takes input as a matrix of single or double datatype. For more information on the input type, you can check the following documentation - https://www.mathworks.com/help/stats/pca.html#:~:text=the%20trained%20model.-,Input%20Arguments,-collapse%20all

カテゴリ

ヘルプ センター および File ExchangeDimensionality Reduction and Feature Extraction についてさらに検索

タグ

質問済み:

2018 年 12 月 6 日

回答済み:

2024 年 10 月 26 日

Community Treasure Hunt

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

Start Hunting!

Translated by