How to find the number of values that are odd?

조회 수: 2 (최근 30일)
Kelara Ghaly
Kelara Ghaly 2020년 6월 16일
댓글: Ron Mahabir 2021년 3월 18일
How do you write a matlab code to find the number of values that are odd mutliples of 11 or 13?
  댓글 수: 3
madhan ravi
madhan ravi 2020년 6월 16일
Did you try anything?
David Hill
David Hill 2020년 6월 16일
(1:2:19)*11;%odd multiples of 11

댓글을 달려면 로그인하십시오.

답변 (1개)

Andrey Smolyakov
Andrey Smolyakov 2020년 6월 16일
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
Rik
Rik 2021년 3월 17일
@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 2021년 3월 18일
Thanks @Rik, I think its worth keeping the discussion so I'll remove the flag.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

제품


릴리스

R2020a

Community Treasure Hunt

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

Start Hunting!

Translated by