Displaying even numbers in a series

2 ビュー (過去 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 Center および File ExchangeDynamic System Models についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by