how to convert single cell-elements to double?

24 vues (au cours des 30 derniers jours)
Payjay
Payjay le 12 Mai 2017
Commenté : Payjay le 12 Mai 2017
Hello everybody, I have a cell array in a cell array, with single elements, which are also from type cell. So it is pretty long-winded to do calculations with these. I would like to convert all these single-cell-elements contained in the other cell-array to a double in the cell array. Do you have any ideas?
Greets and Thanks!

Réponse acceptée

Walter Roberson
Walter Roberson le 12 Mai 2017
I lost track of how many levels of cell you have there. Perhaps
cellfun(@cell2mat, YourCellArray, 'Uniform', 0)
You might even have to...
cellfull( @(C) cellfun( @cell2mat, C, 'Uniform', 0), YourCellArray, 'Uniform', 0)
  1 commentaire
Payjay
Payjay le 12 Mai 2017
Thank you! This is great!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Logical dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by