how to get the division number

2 visualizaciones (últimos 30 días)
Shehab Tarek
Shehab Tarek el 16 de Mayo de 2020
Respondida: KSSV el 16 de Mayo de 2020
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 comentario
Rik
Rik el 16 de Mayo de 2020
Sounds like homework. What have you tried so far? What issue did you encounter?

Iniciar sesión para comentar.

Respuestas (1)

KSSV
KSSV el 16 de Mayo de 2020
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)

Categorías

Más información sobre Get Started with MATLAB en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by