How to change a char array into char row vectors?
16 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Stephen23
le 2 Mar 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.
Réponse acceptée
Jan
le 2 Mar 2021
ListA = ['BETA1'; ...
'BETA2'];
ListAC = cellstr(ListA);
Now you can run REGEXP on the cell string.
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Characters and Strings 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!