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

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

답변 (1개)

Star Strider
Star Strider 2017년 4월 6일
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.…'

카테고리

태그

질문:

2017년 4월 6일

답변:

2017년 4월 6일

Community Treasure Hunt

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

Start Hunting!

Translated by