Clear Filters
Clear Filters

Applying function to cell array

5 views (last 30 days)
Stephen Thompson
Stephen Thompson on 21 Sep 2016
Answered: George on 21 Sep 2016
I want to apply a function to each row in a cell array. I have a 185 x 1 array (called values), each row with 60000 points. I want to apply the function:
min(findchangepts(x,'MaxNumChanges', 2))
I somewhat understand the cellfun function and can do something simple like finding the mean for each row:
avg = cellfun(@mean, values);
How do I apply this more complex function?

Answers (1)

George
George on 21 Sep 2016
Define a function handle and use that as an input to cellfun()

Community Treasure Hunt

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

Start Hunting!