dlmread of a cellarray already in workspace?

Hello,
I 'm given a char cell array, for example 3x1 in size, like the following:
'1 3FF 123'
'0 FFE 234524'
'5 8BA 0458'
I want to convert it to 3 column vectors in dec, hex(or char), and then dec format.
If the cell array is a file, I can easily use dlmread or something like that. But I don't know how I can do that with a cell array. cell2mat doesn't work since the number of characters in each cell are not the same.
Thanks

 Réponse acceptée

Matt Fig
Matt Fig le 15 Août 2012
Will this work?
F = {'1 3FF 123';'0 FFE 234524';'5 8BA 0458'};
G = cellfun(@(x) sscanf(x,'%d %x %d'),F,'Un',0);

Plus de réponses (0)

Catégories

En savoir plus sur Software Development Tools dans Centre d'aide et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by