how can i solve this matlab

how can i solve this ? Using "for" loop with "if" statement generate two vectors "A" and "B" from vector C = [1:100] where vector A has the odd numbers of the vector B has the even number of vector C

Answers (1)

Look at mod() function
C(mod(C,2)==1)

Categories

Find more on MATLAB in Help Center and File Exchange

Products

Asked:

on 30 Nov 2020

Commented:

on 30 Nov 2020

Community Treasure Hunt

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

Start Hunting!