How to remove double quotes from a field?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Bhushan Dhamale
am 23 Mai 2018
Kommentiert: Bhushan Dhamale
am 23 Mai 2018
I have a structure dataMtb which contains a field genes. The field is a cell array having dimension of 4109*1 and contains double-quoted alphanumeric content in each cell. I need to remove the quotes from all the cells. (e.g. "Rv001c" ---> Rv001c). I am attaching the structure file for reference.
0 Kommentare
Akzeptierte Antwort
KSSV
am 23 Mai 2018
S = load('dataMtb.mat') ;
str = S.dataMtb ;
str.gene = cellfun(@char,str.gene,'un',0) ;
0 Kommentare
Weitere Antworten (1)
Fangjun Jiang
am 23 Mai 2018
The double quotes indicate the data is cell array of "string" class, not cell array of "char" class. They are not part of the data value itself.
Not sure what is your real need to "remove" the double quotes, you might want to re-consider whether you want to convert the class of the data.
Siehe auch
Kategorien
Mehr zu Data Types 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!