how to get the division number
조회 수: 2 (최근 30일)
이전 댓글 표시
i want to get the first element to divide on 3
for example
3 is the first element
6 is the second element
9 is the third element
or any number not only 3
댓글 수: 1
답변 (1개)
KSSV
2020년 5월 16일
Read about linspace, mod. It is a basic mathematics that if mod(x,n) = 0, then x is divisible by n.
n = 7 ;
x = 1:15 ;
x(mod(x,n)==0)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!