How to convert numbers in cell array into double?

2 次查看(过去 30 天)
I have a cell array like a = '22 16 55.40', which is dMS values, how to separate these three numbers into three cells into numeric array as follows:-
a = '22 16 55.40' to b = [22 16 55.40]. Any help is greatly appreciated.

采纳的回答

Star Strider
Star Strider 2014-8-23
The textscan function works:
a = {'22 16 55.40'};
b = textscan(char(a), '%f %f %f')
produces:
b =
[22.0000e+000] [16.0000e+000] [55.4000e+000]
with b being a (1x3) cell array.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by