Azzera filtri
Azzera filtri

How to find the largest length of a cell array?

27 visualizzazioni (ultimi 30 giorni)
Hi,
How can I find out the largest size of a cell array element?
For example, this f array contains many doubles within it and I want to find out the largest array size of f. (which is, I know, 500315). But don't know how to find it out.

Risposta accettata

Walter Roberson
Walter Roberson il 4 Apr 2023
max(cellfun(@length, YourCell))
  2 Commenti
Ashfaq Ahmed
Ashfaq Ahmed il 4 Apr 2023
Thank you! This is giving me the size (500315).
I want to plot a graph using this command -
loglog(f{3},temp,'-','linewidth',2);
can you please tell me how can I find out that specific array of f (i.e., f{3}) that contains the maximum length?
Walter Roberson
Walter Roberson il 4 Apr 2023
use the two output form of max. The second output will be the index of the largest cell.
(Well, of one of the cells that is the largest, you might have more than one that length)

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Resizing and Reshaping Matrices in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by