Split comma seperated values inside a cell in to multiple columns
Show older comments
I have a cell which has comma seperated values in each rows. The size of each row is different. I want to split the each value in the row to a seperate column. Any suggestion will be appreciated. A sample cell is attached.
Accepted Answer
More Answers (1)
Simpler and more efficient:
% load your data:
S = load('split_mat.mat');
C = S.split_mat;
% convert to numeric:
F = @(t)sscanf(t,'%f,',[1,Inf]);
D = cellfun(F,C,'uni',0)
1 Comment
Hari krishnan
on 11 Aug 2021
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!