how to get the division number

2 ビュー (過去 30 日間)
Shehab Tarek
Shehab Tarek 2020 年 5 月 16 日
回答済み: KSSV 2020 年 5 月 16 日
i want to get the first element to divide on 3
for example
3 is the first element
6 is the second element
9 is the third element
or any number not only 3
  1 件のコメント
Rik
Rik 2020 年 5 月 16 日
Sounds like homework. What have you tried so far? What issue did you encounter?

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

回答 (1 件)

KSSV
KSSV 2020 年 5 月 16 日
Read about linspace, mod. It is a basic mathematics that if mod(x,n) = 0, then x is divisible by n.
n = 7 ;
x = 1:15 ;
x(mod(x,n)==0)

カテゴリ

Help Center および File ExchangeGet Started with MATLAB についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by