How to add Zero after an integer value?

5 ビュー (過去 30 日間)
Raj Arora
Raj Arora 2022 年 11 月 10 日
編集済み: VBBV 2022 年 11 月 10 日
xcord = [20.76 19.24 20.00];
ycord = [0.0 0.76 -0.76];
Q(loop+new,1) = sprintf(str,nodeno(1,pier)+loop+a,xcord(1,no_of_pier),ycord(1,p),depth-(0.1*(loop)));
Can any one tell me When I am using this code the all values are coming with floating type but 0.0 and 20.0 are not coming. I want these 2 numbers also to come as floating type

回答 (1 件)

VBBV
VBBV 2022 年 11 月 10 日
Use
format long
  2 件のコメント
Raj Arora
Raj Arora 2022 年 11 月 10 日
This is not working VBBV.
VBBV
VBBV 2022 年 11 月 10 日
編集済み: VBBV 2022 年 11 月 10 日
format long
xcord = [20.76 19.24 20.00]
xcord = 1×3
20.760000000000002 19.239999999999998 20.000000000000000
ycord = [1e-20 0.76 -0.76] % very small value close to zero
ycord = 1×3
0.000000000000000 0.760000000000000 -0.760000000000000

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeVector Fields についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by