How to replace on the decimal number only in alphannumeric array?

Hallo, Thanks for reading:
How to replace on the floating number only?
A =
" (:PAR :N X :V 0.0)"
" (:PAR :N Y :V 0.0)"
" (:PAR :N DX :V 2.0)"
" (:PAR :N DY :V 2.0)"

 採用された回答

Kazi Alam
Kazi Alam 2021 年 7 月 15 日

0 投票

Found it
out=regexp(A,'\d?\.?\d+','match')
strrep(A(1),out{1},'2.2')

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCharacters and Strings についてさらに検索

製品

質問済み:

2021 年 7 月 15 日

編集済み:

2021 年 7 月 15 日

Community Treasure Hunt

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

Start Hunting!

Translated by