Question: Write a function that takes an array as an input, and returns an array as an output. Your function should check to make sure that

Write a function that takes an array as an input, and returns an array as an output. Your function should check to make sure that the array has more than one element. If it does not, it should return an empty array. If the array has more than one element, your output should be an array with two elements. The first element should be the first element of the input array. The second element should be the last element of the input array. Please look up the "length" function in MATLAB to help you with this problem.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!