我在help裡面查到有下面兩種用法
[COEFF,SCORE,latent,tsquare] = princomp(X)
[COEFF,latent,explained] = pcacov(V)
我是用princomp
以下為程式碼
A=imread('A.jpg');
PCA=princomp(A);
系統出現
??? Error using ==> minus
Integers can only be combined with integers of the same class, or scalar
doubles.
Error in ==> princomp at 64
x0 = x - repmat(mean(x,1),n,1);
這個指令
請問是哪裡出了問題?
然後我還試了另一種方法
我在網路上找到的
[tmp M]=pca(X',vetor_num);
X為要做PCA的矩陣
vector_num為要取出的向量數
我的程式碼
PCA=princomp(A',3)
系統出現
??? Error using ==> ctranspose
Transpose on ND array is not defined.
我想問是哪邊打錯嗎?
謝謝
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 111.240.230.85
→
12/12 23:53, , 1F
12/12 23:53, 1F
→
12/13 00:45, , 2F
12/13 00:45, 2F
→
12/13 14:44, , 3F
12/13 14:44, 3F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):