How do I find the greater minor number that is divisible by 'n'?

1 回表示 (過去 30 日間)
cfjunior
cfjunior 2013 年 7 月 23 日
How do I find the greatest minor number that is divisible by 'n'?
For example, if I have the number 730 and I want to find the greatest number minor than 730 that when divided by 7 gives me an integer.
I need to write that for 3 cases: divisible by 7, 15 and 30...
tks!

採用された回答

kjetil87
kjetil87 2013 年 7 月 23 日
x=730-rem(730,7)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeClocks and Timers についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by