Rounding down when doing division in Matlab

3 ビュー (過去 30 日間)
L'O.G.
L'O.G. 2022 年 11 月 28 日
回答済み: Arif Hoq 2022 年 11 月 28 日
How do you round when dividing such that
1/7 = 1
2/7 = 1
...
7/7 = 1
8/7 = 2
...
14/7 = 2
15/7 = 3
etc.

採用された回答

Arif Hoq
Arif Hoq 2022 年 11 月 28 日
use ceil function:
a=ceil(1/7)
a = 1
b=ceil(2/7)
b = 1
c=ceil(7/7)
c = 1
d=ceil(8/7)
d = 2

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

タグ

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by