How to change a char array into char row vectors?
58 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Carole Wagnon
el 2 de Mzo. de 2021
Comentada: Stephen23
el 2 de Mzo. de 2021
Hey there
I`m not sure, what format Matlab wishes to have from me. The function 'regexp' generates the error 'Error using regexp. All cells must be char row vectors.'
At the moment, my input looks like:
ListA=
72x2 char array
'BETA1'
'BETA2'
In the Matlabbatch it looks like:
BBEETTAA12
Instead of
'BETA1'
'BETA2'
How should it look like for Matlab to work? And how do I get there?
3 comentarios
Stephen23
el 2 de Mzo. de 2021
S = load('matlab.mat');
S.matlabbatch{1}.spm.util.imcalc.input{:}
I do not see any reason why you cannot call cellstr on those character matrices. But whether this conversion or data type is appropriate for the tool/function/app that you are using depends on that tool/function/app.
Respuesta aceptada
Jan
el 2 de Mzo. de 2021
ListA = ['BETA1'; ...
'BETA2'];
ListAC = cellstr(ListA);
Now you can run REGEXP on the cell string.
1 comentario
Más respuestas (0)
Ver también
Categorías
Más información sobre File Operations en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!