Write a function called ReturnOddEntries.m that accepts as input a column or row array (vector) and...

50.1K

Verified Solution

Question

Advance Math

Write a function called ReturnOddEntries.m that accepts as inputa column or row array (vector) and returns only the odd indexentries. Do this by first setting the even entries to 0, and thenremoving the 0 entries by using a logical array. The first line ofyour code should read

function p = ReturnOddEntries(p)

For example, if you run in the command window p =ReturnOddEntries([1.2 7.1 8.4 -42 100.1 7 -2 4 6]), then you shouldget

p = [1.2 8.4 100.1 -2 6]  

Answer & Explanation Solved by verified expert
3.9 Ratings (515 Votes)
Matlab function for removing odd entriesclear allclose    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students