Accumulate Cells - MATLAB Cody - MATLAB Central

Problem 750. Accumulate Cells

Difficulty:Rate

Given a combining function, a cell array, and an initial value, accumulate the result.

For example,

accumcell(@plus,{1,2,3,4},0) 

should return 10, while

accumcell(@times,{1,2,3,4},1) 

should return 24.

The elements of C should be such that the combining function can apply to them without generating an error (all the same size, for example).

Solution Stats

47.69% Correct | 52.31% Incorrect
Last Solution submitted on May 11, 2024

Problem Comments

Solution Comments

Show comments
PIVlab surpasses 100K all-time File Exchange downloads
During the past twelve months, PIVlab, a MATLAB Community Toolbox for particle...
4
8
LLMs with MATLAB updated to support the latest OpenAI Models
Large Languge model with MATLAB, a free add-on that lets you access...
2
4

Problem Recent Solvers44

Suggested Problems

More from this Author11

Problem Tags

Community Treasure Hunt

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

Start Hunting!