How to save in n different variables string data separated by comma

1 回表示 (過去 30 日間)
Juan Jose Ortiz Torres
Juan Jose Ortiz Torres 2019 年 4 月 9 日
Hi everybody.
I need help please. Anyone know how can I save string number composed by 2 columns and n rows in 2 different variables?. For example in the first iteration, the string is like the following:
RX='0.036,0.029'
I expect the algorithm divide the string until the comma then create the variables A and B with the coefficients data:
A=0.036
B=0.029
Thanks

採用された回答

A. Sawas
A. Sawas 2019 年 4 月 9 日
% RX='0.036,0.029'
v = sscanf(RX, '%g,%g');
A = v(1);
B = v(2);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by