replaceing a specific character in a cell array of strings

조회 수: 6 (최근 30일)
FATEMEH
FATEMEH 2012년 5월 10일
I have a cell array of {'12034' '10045' '24000' } I need to replace all the third characters by '.'. so I need {'12.34' '10.45' '24.00' }. thanks

답변 (1개)

Walter Roberson
Walter Roberson 2012년 5월 10일
cellfun(@(S) [S(1:2) '.' S(4:end)], YourCell, 'Uniform', 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