I have a Table in MATLAB. In one colum, lots of texts are seperated in comma. I wish to delimate those in seperate colums.
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Seum Bin Rahman
am 12 Okt. 2019
Beantwortet: Guillaume
am 12 Okt. 2019
I have a Table in MATLAB. In one colum, lots of texts are seperated in comma. I wish to delimate those in seperate colums.
clc
clear
raw=readtable('Service.xlsx');
r=0;
raw_problem=raw.Expert_Found_Problems;
P=height(raw);
for i=1:1:P
PROBLEMS=raw_problem{i,1};
C = strsplit(PROBLEMS,',')
r=r+1
T(r,:)=table(C)
end
0 Kommentare
Akzeptierte Antwort
Guillaume
am 12 Okt. 2019
It's not clear what you want as an output since for each row you're going to get a different number of elements after the split. Maybe:
raw.Expert_Found_Problems = cellfun(@(s) strsplit(s, ','), raw.Expert_Found_Problems, 'UniformOutput', false);
which creates a column cell array of cell arrays.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Text Files 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!