2012-12-03 30 views
-1

我已經有一個直方圖,並希望使用histc而不是hist,因爲後者給我箱的中心值。錯誤使用「histc」 - matlab

當我運行下面的命令:

>> [h, bins] = histc(H) 

我得到以下錯誤:

??? Error using ==> histc 
Not enough input arguments. 

這是爲什麼?我該怎麼辦?

謝謝。

+0

想知道如果我幫你解決問題嗎? upvote我的答案/標記是正確的? –

回答

0

您需要包括可變邊緣:(Matlab的幫助):

N = histc(X,EDGES), for vector X, counts the number of values in X 
that fall between the elements in the EDGES vector (which must contain 
monotonically non-decreasing values). N is a LENGTH(EDGES) vector 
containing these counts. 

它應該是兩個長陣列即像[2 4]其中上限和下限分別是2和4。