필터 지우기
필터 지우기

Separate a cell into separate numbers

조회 수: 2 (최근 30일)
Raziur Rahman
Raziur Rahman 2015년 8월 17일
답변: Walter Roberson 2015년 8월 17일
I have 4 values in a cell format, like this way "-1,-2,-3.4,-4". I would like to separate this 4 values and use them as 4 different number? How can I do that?

채택된 답변

Walter Roberson
Walter Roberson 2015년 8월 17일
If "1,-2,-3.4,-4" indicates a comma separated string, then
numstring = '1,-2,-3.4,-4';
numeric_values = sscanf(numstring,'%f,');
after which it is often best to leave them as an array.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by