How to use use histc in multiple array
Show older comments
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 and then i want to take the average of the bin of all the six arrays. i know to access the values in the cell array but i have struggling to solve this problem. Any suggestion. Thanks.
Answers (2)
Azzi Abdelmalek
on 8 Jul 2015
0 votes
You can use a for loop
2 Comments
gustavo sanchez
on 9 Jul 2015
Edited: Azzi Abdelmalek
on 9 Jul 2015
Azzi Abdelmalek
on 9 Jul 2015
add this
a=cell2mat(F')
out=mean(a,2)
Andrei Bobrov
on 9 Jul 2015
Edited: Andrei Bobrov
on 9 Jul 2015
a = cellfun(@(x)histc(x,1:0.5:10),F,'un',0);
out = mean([a{:}],2);
Categories
Find more on Matrices and Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!