Displaying even numbers in a series

3 Ansichten (letzte 30 Tage)
Saif
Saif am 1 Dez. 2022
Beantwortet: David Hill am 1 Dez. 2022
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.

Akzeptierte Antwort

David Hill
David Hill am 1 Dez. 2022
n=1:.5:10;
n(mod(n,2)==0)
ans = 1×5
2 4 6 8 10

Weitere Antworten (0)

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by