getting numbers from a cell

I want to get the numbers from the cell below and have them as a Matrix:
A =
'1.39675e-02 -2.58099e-01 -8.32728e-03 0.00000e+00 2.19518e+01 1.21930e-01 0.00000e+00 3.00000e-05 3.00000e+02 9.98200e+02 1.41117e-11 '

1 个评论

More efficient than STR2NUM:
V = sscanf(A,'%f')
V = 11×1
0.0139675 -0.258099 -0.00832728 0 21.9518 0.12193 0 3e-05 300 998.2

请先登录,再进行评论。

 采纳的回答

A = '1.39675e-02 -2.58099e-01 -8.32728e-03 0.00000e+00 2.19518e+01 1.21930e-01 0.00000e+00 3.00000e-05 3.00000e+02 9.98200e+02 1.41117e-11 ';
Anum = str2num(A)
Anum = 1×11
0.0140 -0.2581 -0.0083 0 21.9518 0.1219 0 0.0000 300.0000 998.2000 0.0000

更多回答(0 个)

类别

在 帮助中心 和 File Exchange 中查找有关 Mathematics 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by