How to change a char array into char row vectors?
16 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Carole Wagnon
am 2 Mär. 2021
Kommentiert: Stephen23
am 2 Mär. 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 Kommentare
Stephen23
am 2 Mär. 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.
Akzeptierte Antwort
Jan
am 2 Mär. 2021
ListA = ['BETA1'; ...
'BETA2'];
ListAC = cellstr(ListA);
Now you can run REGEXP on the cell string.
1 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Characters and Strings finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!