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

 Respuesta aceptada

Matt Fig
Matt Fig el 15 de Ag. de 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);

Más respuestas (0)

Categorías

Más información sobre Software Development Tools en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 15 de Ag. de 2012

Community Treasure Hunt

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

Start Hunting!

Translated by