how to calculate %?

4 ビュー (過去 30 日間)
Minh
Minh 2022 年 9 月 21 日
コメント済み: Image Analyst 2022 年 9 月 22 日
I need to calculate % by dozens of formulas x = (x% 100) / 10 but in MATLAB behind % is a comment?

採用された回答

Image Analyst
Image Analyst 2022 年 9 月 21 日
Try this:
x = 23;
str = sprintf('%3.3d', x)
fprintf("hundreds :%s\n", str(1));
fprintf(" tens :%s\n", str(2));
fprintf(" units :%s\n", str(3));
x = 456
str = sprintf('%3.3d', x)
fprintf("hundreds :%s\n", str(1));
fprintf(" tens :%s\n", str(2));
fprintf(" units :%s\n", str(3));
  4 件のコメント
Minh
Minh 2022 年 9 月 22 日
i want to use formula to calculate but you helped me to do a simpler way that's what i asked for.!
Image Analyst
Image Analyst 2022 年 9 月 22 日
OK, then please Accept the best answer and "vote" for the other one.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

製品


リリース

R2016b

Community Treasure Hunt

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

Start Hunting!

Translated by