Effacer les filtres
Effacer les filtres

Convert cell to matrix

1 vue (au cours des 30 derniers jours)
Martin Park
Martin Park le 6 Oct 2013
Réponse apportée : Jan le 6 Oct 2013
I have the following {'128' '256' '157' '54'} How can I convert it to a numeric matrix for example 128 256 157 54
  1 commentaire
Martin Park
Martin Park le 6 Oct 2013
I mean
128 256
157 54

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 6 Oct 2013

Plus de réponses (1)

Jan
Jan le 6 Oct 2013
Faster than str2double:
C = {'128' '256' '157' '54'};
S = sprintf('%s*', C{:});
D = sscanf(S, '%g*');

Catégories

En savoir plus sur Data Type Conversion 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