how to convert a string contains number seperated by commas into a matrix of numbers

2 次查看(过去 30 天)
if a string s='6,7,8,9,19' how can i convert it as matrix=[6 7 8 9 19]

采纳的回答

KSSV
KSSV 2016-10-24
编辑:KSSV 2016-10-24
s='6,7,8,9,19' ;
matrix = str2num(s);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Type Conversion 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by