Without mod function and any loops(i.e for or while)

10 ビュー (過去 30 日間)
Vikas Rahar
Vikas Rahar 2019 年 11 月 3 日
コメント済み: Vikas Rahar 2019 年 11 月 4 日
I am wondering, is it poosible to find the even or odd numbers in a vector whithout using mod(or any inbulit functions) function or loops?
  2 件のコメント
KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 11 月 4 日
Without any function, or we can use other functions apart from mod or rem?
Vikas Rahar
Vikas Rahar 2019 年 11 月 4 日
I am hoping to not use any function at all.

サインインしてコメントする。

採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2019 年 11 月 4 日
編集済み: KALYAN ACHARJYA 2019 年 11 月 4 日
Here I have used one bitget function or without any function???
a=[3 4 5 6 8]; % Just an example
data_odd=a.*bitget(a,1);
data_odd(data_odd==0)=[]
data_even=a.*~bitget(a,1);
data_even(data_even==0)=[]

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDimensionality Reduction and Feature Extraction についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by