How to change a char array into char row vectors?
59 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Stephen23
il 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.
Risposta accettata
Jan
il 2 Mar 2021
ListA = ['BETA1'; ...
'BETA2'];
ListAC = cellstr(ListA);
Now you can run REGEXP on the cell string.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su File Operations in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!