Matlab For this problem you will repeat the analysis of compressive strengths th
ID: 3573943 • Letter: M
Question
Matlab
For this problem you will repeat the analysis of compressive strengths that you did for Project 4 using MATLAB instead of C++. New data has been stored in the MATLAB file called CMPSC201P5. mat. Review section 4.1 of Chapter 1 in your textbook and use a command to import this data into MATLAB (do not use the import wizard!) Your code should be designed so it can be used for arrays of different sizes. Use a MATLAB function to determine the number of formulations (number of rows) and the number of plants (number of columns). Using a single MATLAB command, create a column vector that contains the minimum compressive strength of each formulation. Using a single MATLAB, command create a column vector that contains the maximum compressive strength of each formulation. Using a single MATLAB command determine the average compressive strength for each formulation after removing the minimum and maximum compressive strength for that formulation and store these average values in a column vector. Use a nested loop and a simple if to review each compressive, output a message similar to that given below for those not with range of 15 and 75 MPa inclusive, and count how many compressive strengths were suspect (Do not use any MATLAB built-in functions for this review). Once through the nested loop output how many compressive strengths were suspect. The value of 14.56 from plant 1 for formulation 8 is suspect. Create a 2-dimensional array (do not use table command) containing the formulation numbers (1 to the number of formulations), the minimum compressive strengths for each formulation, the maximum compressive strengths for each formulation, and the average compressive strength for each formulation. Using this table and a single fprintf command create output similar to the following: Formulation ___ had ____ a minimum compressive strength of ______, a maximum compressive strength of _________, and an average compressive strength of_________. The minimum and maximum strengths should be displayed with 1 digit to the right of the decimal whereas the average should be displayed with 2 digits to the right of the decimal.Explanation / Answer
Answer:
function sizeVal = find_ArraySizeVal(m1)
sizeVal = [];
m1(f(end), f(end));
function r1 = f(e1)
r1=[];
sizeVal=[sizeVal e1];
end
end
formulationsCalc = []
plantsCalc = []
indexVal = 1
A1 = rand(4,3);
resVal = find_sizeOf(A1)
formulationsCalc(indexVal) = resVal(1)
plantsCalc(indexVal) = resVal(2)
indexVal = indexVal + 1
A1 = rand(5,2);
resVal = find_sizeOf(A)
formulationsCalc(indexVal) = resVal(1)
plantsCalc(indexVal) = resVaL(2)
indexVal = indexVal + 1
A1 = rand(3,3);
rest = find_sizeOf(A)
formulationsCalc(indexVal) = resVal(1)
plantsCalc(indexVal) = resVal(2)
indexVal = indexVal + 1
formulationsCalc
plantsCalc
disp('Average formulations: ');
disp(mean(formulations))
disp('Average Plants: ');
disp(mean(plants))