Clear Filters
Clear Filters

How to find the minimum length of a cell array

6 views (last 30 days)
M= {10x107} {10x108} {10x103} {10x105}
how do i find the minimum length among the cells? eg. 103

Accepted Answer

Matt J
Matt J on 10 Dec 2017
min( cellfun(@(c) size(c,2), M) )

More Answers (1)

Stephen23
Stephen23 on 11 Dec 2017
Edited: Stephen23 on 11 Dec 2017
Simpler and faster:
min(cellfun('size',M,2))

Categories

Find more on Data Types in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!