从字符向量的单元格数组中提取数字

时间:2019-05-27 12:03:30

标签: string matlab gps cell text-parsing

我有一个包含GPS数据的char单元1x8893,我想将纬度和经度提取到2个单独的数组中。这是GPS数据。

https://i.stack.imgur.com/ZUmNU.png

我尝试了以下

latLocations = find(gps == 'latitude: ');
for i=1:97
    lat(i) = str2double(gps(latLocations(i)+1:latLocations(i)+9));
end

我跑到97,因为其中有97个经纬度数据。 但是我收到一个错误:

  

矩阵尺寸必须一致。

感谢您的帮助。

0 个答案:

没有答案