cell array with numeric values only
3 ビュー (過去 30 日間)
古いコメントを表示

Conver this array to an array with numbers only so it can be used for a graph
0 件のコメント
採用された回答
その他の回答 (2 件)
Stephen23
2020 年 11 月 2 日
Do NOT use loops or cellfun for this, unless you really want to write complex and slow MATLAB code.
The most efficient solution is to use sscanf like this:
C = {'long: 151.125#';'long: 151.126#'};
V = sscanf([C{:}],'long:%f#')
0 件のコメント
Akira Agata
2020 年 11 月 2 日
Another possible solution:
C = {'long: 151.125#';'long: 151.126#'};
V = regexp(C,'[?\d.]+','match','once');
V = str2double(V);
>> V
V =
151.1250
151.1260
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!