Displaying even numbers in a series

조회 수: 3 (최근 30일)
Saif
Saif 2022년 12월 1일
답변: David Hill 2022년 12월 1일
I am suppose to come up with code that displays the even numbers of a series but I am a little lost. The series is a series of numbers between 1-10 with 0.5 increments.

채택된 답변

David Hill
David Hill 2022년 12월 1일
n=1:.5:10;
n(mod(n,2)==0)
ans = 1×5
2 4 6 8 10

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Mathematics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by