Effacer les filtres
Effacer les filtres

How to find the number of values that are odd?

2 vues (au cours des 30 derniers jours)
Kelara Ghaly
Kelara Ghaly le 16 Juin 2020
Commenté : Ron Mahabir le 18 Mar 2021
How do you write a matlab code to find the number of values that are odd mutliples of 11 or 13?
  3 commentaires
madhan ravi
madhan ravi le 16 Juin 2020
Did you try anything?
David Hill
David Hill le 16 Juin 2020
(1:2:19)*11;%odd multiples of 11

Connectez-vous pour commenter.

Réponses (1)

Andrey Smolyakov
Andrey Smolyakov le 16 Juin 2020
If I understand you correctly, you may try something like this:
x = 120:230;
m = x((mod(x,11)==0 | mod(x,13)==0) & mod(x,2)==1);
  11 commentaires
Rik
Rik le 17 Mar 2021
@Ron Mahabir Do you still requestion deletion of the two answers? If not, feel free to remove the flags. I could also do that, but I would prefer it if you did.
Ron Mahabir
Ron Mahabir le 18 Mar 2021
Thanks @Rik, I think its worth keeping the discussion so I'll remove the flag.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange

Produits


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by