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

조회 수: 1 (최근 30일)
Kazi Alam
Kazi Alam 2021년 7월 15일
편집: Kazi Alam 2021년 7월 15일
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일
Found it
out=regexp(A,'\d?\.?\d+','match')
strrep(A(1),out{1},'2.2')

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Characters and Strings에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by