[問題] princomp的用法已回收

看板MATLAB作者時間15年前 (2010/12/12 18:40), 編輯推噓0(003)
留言3則, 2人參與, 最新討論串1/2 (看更多)
我在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
imread讀進來的A是純數字矩陣嗎?
12/12 23:53, 1F

12/13 00:45, , 2F
恩!而且為uint8格式
12/13 00:45, 2F

12/13 14:44, , 3F
先轉成double或是integer
12/13 14:44, 3F
文章代碼(AID): #1D1AQFyQ (MATLAB)
文章代碼(AID): #1D1AQFyQ (MATLAB)