Applying function to cell array

1 次查看(过去 30 天)
Stephen Thompson
Stephen Thompson 2016-9-21
回答: George 2016-9-21
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?

回答(1 个)

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

类别

Help CenterFile Exchange 中查找有关 Programming 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by