Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

IN MATLAB 1. Create a vector called V, which consists of all integers from -3 to 5. 2. Use the MATLAB function mod on the

IN MATLAB

image text in transcribed

1. Create a vector called V, which consists of all integers from -3 to 5. 2. Use the MATLAB function mod on the vector V to determine which integer is even. Call the result new. For example, mod(-2,2) = 0 where 0 is the remainder of dividing -2 by 2. Hence, -2 is an even number. 3. Pick up the even integers by doing the following: E = V(new == 0). new == 0 will give you True/False results in 1's and O's. O means that particular integer is even. Hence, V(new == 0) will give you all the even numbers from the array. 4. Create a vector called B, which consists of all integers from -3 to 5. 5. Use the MATLAB function mod on the vector b to determine which integer is odd. Call the result b. For example, mod(-3,2) = 1 where 1 is the remainder of diving -3 by 2. Hence, -3 is an odd number. 6. Pick up the odd integers by doing the following: 0 = B(b == 1). new == 1 will give you True/False results in 1's and O's. 1 means that particular integer is odd. Hence, O = B(b == 1) will give you all the odd numbers from the array. 1. Create a vector called V, which consists of all integers from -3 to 5. 2. Use the MATLAB function mod on the vector V to determine which integer is even. Call the result new. For example, mod(-2,2) = 0 where 0 is the remainder of dividing -2 by 2. Hence, -2 is an even number. 3. Pick up the even integers by doing the following: E = V(new == 0). new == 0 will give you True/False results in 1's and O's. O means that particular integer is even. Hence, V(new == 0) will give you all the even numbers from the array. 4. Create a vector called B, which consists of all integers from -3 to 5. 5. Use the MATLAB function mod on the vector b to determine which integer is odd. Call the result b. For example, mod(-3,2) = 1 where 1 is the remainder of diving -3 by 2. Hence, -3 is an odd number. 6. Pick up the odd integers by doing the following: 0 = B(b == 1). new == 1 will give you True/False results in 1's and O's. 1 means that particular integer is odd. Hence, O = B(b == 1) will give you all the odd numbers from the array

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Genomes And Databases On The Internet A Practical Guide To Functions And Applications

Authors: Paul Rangel

1st Edition

189848631X, 978-1898486312

More Books

Students also viewed these Databases questions

Question

2. What efforts are countries making to reverse the brain drain?

Answered: 1 week ago