Finding maximum integer between [100,200] divisible by 21?
조회 수: 3 (최근 30일)
이전 댓글 표시
I want use "for" and "while" to get the result.
댓글 수: 1
Jan
2018년 11월 21일
This sounds like a homework question. Using for and while will be hard, but one or the other is smart enough. Please post, what you have tried so far and ask a specific question. The forum will not solve your homework. You need one line of code only, therefore it is hard to give some hints without posting the complete solution.
답변 (2개)
Jan
2018년 11월 21일
Hints:
- The vector of number from 100 to 200:
100:200
- Dividable by 21:
mod(x, 21) == 0
- The maximum value can be found by the max() command, or by find(y, 1, 'last')
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!