How can I use 'Text divide' function(in Excel) in Matlab??

2 visualizzazioni (ultimi 30 giorni)
I have so many CSV files, but they formed right this(below).. That string and number are all in the one cell. Is there ways to cut this data automatically?? Please help me..T.T
[Content]
meter 1;121.6;0.6845;0.3152;;meter 1;123.0;0.6845;0.3151;meter 1;121.4;0.6844;0.3152

Risposte (1)

Star Strider
Star Strider il 6 Apr 2017
Experiment with regexp:
strc = {'meter 1;121.6;0.6845;0.3152;;meter 1;123.0;0.6845;0.3151;meter 1;121.4;0.6844;0.3152'};
parstr = regexp(strc{:}, {';',';;'}, 'split');
parstr{1}
parstr{2}
ans =
1×13 cell array
Columns 1 through 8
'meter 1' '121.6' '0.6845' '0.3152' '' 'meter 1' '123.0' '0.6845'
Columns 9 through 13
'0.3151' 'meter 1' '121.4' '0.6844' '0.3152'
ans =
1×2 cell array
'meter 1;121.6;0.6845;0.3152' 'meter 1;123.0;0.6845;0.3151;meter 1;121.…'

Tag

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by