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

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

Without any function, or we can use other functions apart from mod or rem?
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개)

카테고리

도움말 센터File Exchange에서 Dimensionality Reduction and Feature Extraction에 대해 자세히 알아보기

태그

질문:

2019년 11월 3일

댓글:

2019년 11월 4일

Community Treasure Hunt

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

Start Hunting!

Translated by