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

Image Analyst
Image Analyst 2014년 11월 19일
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?

댓글을 달려면 로그인하십시오.

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2014년 11월 19일
편집: Azzi Abdelmalek 2014년 11월 19일

0 개 추천

v={'bug fixes'; 'stability improved'; 'new feature added'}
out=regexp(v,'\S+','match')
out= [out{:}]

댓글 수: 1

chenyu
chenyu 2014년 11월 20일
Thanks a lot! It works perfectly!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Characters and Strings에 대해 자세히 알아보기

질문:

2014년 11월 19일

댓글:

2014년 11월 20일

Community Treasure Hunt

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

Start Hunting!

Translated by