```Date: Nov 23, 2012 7:05 PM
Author: Michael
Subject: find location in matrix and print min and max for each column batch

I'm having an issue with the last part of an assignment. Part (b), ii and iii and part (e). I can't seem to be able to display the locations for part (b) or print the batch # corresponding to the min and max values for each row. Can anyone help? "Consider the data file ?suture.txt? in Prob.5-12 (on page 150) of your textbook. Thefile contains information on batches of sutures that have been rejected during a one week period. Each line contains four columns of data (the batch number,temperature, pressure, and dwell time) . Place the content of suture.txt in a Matlabdata file with the name ?suture.mat? in your current directory. Use the Matlabcommand ?load? to load the data file and place each column in an appropriate one dimensionalarray.a) First verify the data file by printing the content of suture.mat in four columns. Besure to label the four columns appropriately.b) Write a user-defined function called func(a,b,x) with three input variables. Yourfunction func should do the following:(i) print all the locations of the one-dimensional array x that fall outside theinterval (a,b), where b > a.(ii) print out the maximum value of x and its location.(iii) print out the minimum value of x and its location.(iv) return percentage of the elements of the one-dimensional array x that areoutside the interval (a,b), where b > a.Note: You may use the Matlab command ?find?.c) Now using func, determine the percentages of rejected batches based ontemperature, pressure, and dwell time.d) Using your user-defined function func, print the batch numbers corresponding torejected batches based on temperature, pressure, and dwell time. Also print thepercent of batches that are rejected on the basis of temperature, pressure, anddwell time.e) Print the batch number for the patient with the minimum and maximumtemperature, pressure, and dwell time."----------------------------------------------------------------------------------------------------------------Here is my main script: %          Problem 2: Data Files and User-Defined Functions%  State Problem 2fprintf(' \n \n                         Problem 2                       ');%  Load the suture.txt files = load('suture.txt');%  Format the number displayformat shortg%  Display the data file in four columnsfprintf(' \n \n    Batch Number   Temperature   Pressure   Dwell Time \n');disp(s);%  Temperaturec = s(:,2);[n,Max,Min,p] = func(150,170,c);fprintf('The rejected batch number(s) based on temperature is: %3.0f \n', s(n,1));fprintf('The percent of rejected batches based on temperature is: %3.0f%% \n', p);fprintf('The batch number with minimum temperature is: %3.1f \n', Min);fprintf('The batch number with maximum temperature is: %3.1f \n \n', Max);%  Pressurec = s(:,3);[n,Max,Min,p] = func(60,70,c);fprintf('The rejected batch number(s) based on pressure is: %3.0f \n', s(n,1));fprintf('The percent of rejected batches based on pressure is: %3.0f%% \n', p);fprintf('The batch number with minimum pressure is: %3.1f \n', Min);fprintf('The batch number with maximum pressure is: %3.1f \n \n', Max);%  Dwell Time c = s(:,4);[n,Max,Min,p] = func(2.0,2.5,c);fprintf('The rejected batch number(s) based on dwell time is: %3.0f \n', s(n,1));fprintf('The percent of rejected batches based on dwell time is: %3.0f%% \n', p);fprintf('The batch number with minimum dwell time is: %3.1f \n', Min);fprintf('The batch number with maximum dwell time is: %3.1f \n', Max);----------------------------------------------------------------------------------------------------------------Here is my data file info for which I need to find the values (save as suture.text): 24551 145.5 62.3 2.1324582 153.7 63.0 2.5226553 160.4 58.8 2.5126613 159.5 58.9 2.0226624 160.5 61.5 1.9827725 170.9 62.5 2.03----------------------------------------------------------------------------------------------------------------Here is my func function: function [n,Max,Min,p] = func(a,b,x)n = find(x<a|x>b);Max = max(x);Min = min(x);p = (length(n)/length(x))*100;end
```