Comma separated value to vector

조회 수: 10 (최근 30일)
Matthew Tyler Jeffries
Matthew Tyler Jeffries 2019년 5월 9일
댓글: Matthew Tyler Jeffries 2019년 5월 9일
I have a table where the element in the first row of the second column is "11,333,4445,2,78,2399". I would like to take this element, remove the commas, and turn it into a vector v=[11 333 4445 2 78 2399].

채택된 답변

Stephen23
Stephen23 2019년 5월 9일
>> S = '11,333,4445,2,78,2399';
>> V = sscanf(S,'%f,',[1,Inf])
V =
11 333 4445 2 78 2399
  댓글 수: 1
Matthew Tyler Jeffries
Matthew Tyler Jeffries 2019년 5월 9일
Brilliant! This is exactly what I need. Thank you.

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Tables에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by