Question: Function Name: piEcesOfPie Inputs: 3. (cell) MX3 The cell array containing all the data you have on the orders Outputs: 3. (cell) MX3 The cell

Function Name: piEcesOfPie

Inputs: 3. (cell) MX3 The cell array containing all the data you have on the orders Outputs: 3. (cell) MX3 The cell array with the missing values calculated.

Topics: (iteration), (cell arrays), (conditionals)

Background: Here at the Archimedes bakery you are preparing for the influx of orders that are sure to come with pi day. In order to handle the increased volume, the bakery is automating some of the orders that are coming in, and have stored that relevant data for each pie in a cell array. Unfortunately, the customers did not properly read the instructions on the online ordering site, and most of the orders are missing some key measurements. Fortunately, you realize a way to calculate each of the missing values from the data you have using MATLAB!

Function Description: You will be given a cell array containing numerical values corresponding to the volume (V) (column 1), radius (R) (column 2), and height (h) (column 3) of a cylinder shaped pie. Every row is a different pie. Some values are missing and have been replaced with the corresponding variables. Missing variables in column 1 have been replaced with 'V', missing variables in column 2 have been replaced with 'R', and missing variables in column 3 have been replaced with 'h'. With this data given, iterate through the cell array and replace the values of type char with the corresponding numerical values. Calculate the missing values using the following equation and round the value to 2 decimal places: = 2

Example: ca ={'V',3,2; 10,3,'h'}; [ca_fix]= piEcesOfPie(ca); ca_fix -> {56.55,3, 2; 10 ,3,0.35}

Notes: Each row will have at most one missing variable Make sure to round the values that you enter into the cell array to 2 decimal points

SOLVE USING MATLAB, DO NOT HARDCODE

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!