How to remove space after using num2str?

조회 수: 29 (최근 30일)
Santosh Biradar
Santosh Biradar 2022년 9월 1일
편집: Stephen23 2022년 9월 1일
Hi
DecOriginTime = num2str(OriginTime);
>> OriginTime =
1.7984
1.7986
1.7988
1.7990
1.7992
1.7994
1.7996
1.7998
>>DecOriginTime =
'1798.4'
'1798.6'
'1798.8'
' 1799'' %%I need this as '1799'. How to remove space?
'1799.2'
'1799.4'
'1799.6'
'1799.8'
Please let me know for brief
Thank You

채택된 답변

Stephen23
Stephen23 2022년 9월 1일
편집: Stephen23 2022년 9월 1일
V = [1798.4;1798.6;1798.8;1799;1799.2;1799.4;1799.6;1799.8]
V = 8×1
1.0e+03 * 1.7984 1.7986 1.7988 1.7990 1.7992 1.7994 1.7996 1.7998
S = string(V)
S = 8×1 string array
"1798.4" "1798.6" "1798.8" "1799" "1799.2" "1799.4" "1799.6" "1799.8"

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by