Azzera filtri
Azzera filtri

How to find the number of values that are odd?

2 visualizzazioni (ultimi 30 giorni)
Kelara Ghaly
Kelara Ghaly il 16 Giu 2020
Commentato: Ron Mahabir il 18 Mar 2021
How do you write a matlab code to find the number of values that are odd mutliples of 11 or 13?

Risposte (1)

Andrey Smolyakov
Andrey Smolyakov il 16 Giu 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 Commenti
Rik
Rik il 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 il 18 Mar 2021
Thanks @Rik, I think its worth keeping the discussion so I'll remove the flag.

Accedi per commentare.

Categorie

Scopri di più su Introduction to Installation and Licensing in Help Center e File Exchange

Prodotti


Release

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by