How to use histc for multiple array

i have the following cell array F=
[710x1 double]
[711x1 double]
[711x1 double]
[711x1 double]
[713x1 double]
[714x1 double]
I want to use the element in each array to build a bin with range *x=1:0.5:10* using histc that means *histc(F{1,1},)* .... *histc(F{6,1},x)* and then i want to take the average of the bin of all the six arrays. So finally i will have a singe array with average bin. Any suggestion. Thanks.

回答 (1 件)

Andrei Bobrov
Andrei Bobrov 2015 年 7 月 9 日

0 投票

a = cellfun(@(x)histc(x,1:0.5:10),F,'un',0);
out = mean([a{:}],2);

カテゴリ

ヘルプ センター および File ExchangeData Types についてさらに検索

質問済み:

2015 年 7 月 9 日

回答済み:

2015 年 7 月 9 日

Community Treasure Hunt

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

Start Hunting!

Translated by