cell array problem help

1 view (last 30 days)
chenyu
chenyu on 19 Nov 2014
Commented: chenyu on 20 Nov 2014
Hello,
I'm trying to do text classification by using Matlab. While I got struck in the beginning. I have training data in csv file like {bug fixes; stability improved; new feature added} And how can I convert it into a cell array with a single word in each cell, like {bug;fixes;stability;improved;...}?
I am trying to use textscan but it seems not work.
Thanks a lot.
  1 Comment
Image Analyst
Image Analyst on 19 Nov 2014
There's no comma in {bug fixes; stability improved; new feature added}. And you forgot to attach the csv file to make it easy for us to help you. Can you do that?

Sign in to comment.

Accepted Answer

Azzi Abdelmalek
Azzi Abdelmalek on 19 Nov 2014
Edited: Azzi Abdelmalek on 19 Nov 2014
v={'bug fixes'; 'stability improved'; 'new feature added'}
out=regexp(v,'\S+','match')
out= [out{:}]
  1 Comment
chenyu
chenyu on 20 Nov 2014
Thanks a lot! It works perfectly!

Sign in to comment.

More Answers (0)

Categories

Find more on Characters and Strings 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!