The size of nested cells

1 vue (au cours des 30 derniers jours)
Amir Mahmoudi
Amir Mahmoudi le 1 Oct 2024
Commenté : Amir Mahmoudi le 1 Oct 2024
I have a cell array. Each cell contains an n by m cell. How can I get "m"?

Réponse acceptée

Manish
Manish le 1 Oct 2024
Hi Amir,
I understand that you want to find the value of ‘m’ in a n*m cell array.
Here the code implementation to find the value of m:
CellArray = {
{1, 2, 3; 4, 5, 6},
{7, 8, 9; 10, 11, 12}
};
% Access the first inner cell array
innerCellArray = CellArray{1};
% Get the size of the inner cell array
[~, m] = size(innerCellArray);
% Display the value of m
disp(m);
Hope this helps!
  1 commentaire
Amir Mahmoudi
Amir Mahmoudi le 1 Oct 2024
Thanks

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Structures dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by