Filter löschen
Filter löschen

How to find the number of values that are odd?

2 Ansichten (letzte 30 Tage)
Kelara Ghaly
Kelara Ghaly am 16 Jun. 2020
Kommentiert: Ron Mahabir am 18 Mär. 2021
How do you write a matlab code to find the number of values that are odd mutliples of 11 or 13?
  3 Kommentare
madhan ravi
madhan ravi am 16 Jun. 2020
Did you try anything?
David Hill
David Hill am 16 Jun. 2020
(1:2:19)*11;%odd multiples of 11

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Andrey Smolyakov
Andrey Smolyakov am 16 Jun. 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 Kommentare
Rik
Rik am 17 Mär. 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 am 18 Mär. 2021
Thanks @Rik, I think its worth keeping the discussion so I'll remove the flag.

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Introduction to Installation and Licensing finden Sie in Help Center und File Exchange

Produkte


Version

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by