Question: in matlab: 1 . a ) Create a subfunction named arbitrary _ math that has one input and one output. The function should expect the
in matlab: a Create a subfunction named arbitrarymath that has one input and one output. The
function should expect the input to be a x array of integers. If the first row contains one odd
and one even number, the function should return the arithmetic mean of the elements in the
second row as its output. If the first row contains either two odd or two even numbers, it should
return the geometric mean of the elements in the second row as its output.
b Write the line n ; at the top of a new section of code. Write code that will create a xn
empty cell array named Data Use for loops and if statements to fill in Data with x arrays
that read as the Fibonacci sequence when read in Matlab reading order the first cell should
contain ;; the second ; etc. Create a xn array of zeros named
ProcessedData
c Use a for loop to run the arbitrarymath function on every cell of Data and assign the
outputs to ProcessedData Once all calculations have been made, display the nth cell of
Data and the entirety of ProcessedData in the command window only display them once,
at the end Change the value of n at the top of your code to and run it again. Your submission
need only include the output for n
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
