Question
Please do part 3 of problem #2 and use MATLAB. Problem #2 Sutures are strands or fibers used to sew living tissue together after an
Please do part 3 of problem #2 and use MATLAB.
Problem #2 Sutures are strands or fibers used to sew living tissue together after an injury or an operation. Packages of sutures must be sealed carefully before they are shipped to hospitals so that contaminants cannot enter the packages. The substance that seals the package is referred to as the sealing die. Generally, sealing dies are heated with an electric heater. For the scaling process to be a success, the sealing die is maintained at an established temperature and must contact the package with a predetermined pressure for a specific period of time, known as the dwell time. Assume that the ranges of parameters for an acceptable seal are the following: Temperature: 150 170 C Pressure: 60 70 psi (pounds per square inch) Dwell Time: 2.0 2.5 seconds If the conditions of the sealing die are outside of these ranges, then the particular suture batch is rejected. Assume the manufacturer collects information on batches of sutures that have been rejected during a one-week period and stores it in a data file. Each line in the file contains the batch number, the temperature, the pressure, and the dwell time for a rejected batch.
Required Tasks You are to write a program to help a quality-control engineer analyze the failure modes of the rejected suture batches. It should: 1. Prompt the user to enter the name of the data file. 2. Load and store the data from the file. 3. Calculate the following statistics: the percent of the batches rejected due to temperature the percent rejected due to pressure, and the percent rejected due to dwell time. 4. Display a table that shows each batch number and indicates whether that batch passed or failed a particular sealing die condition. These are the specific requirements: 1. Write a MATLAB function named ReadBatchData that: Accepts a string that is the name of the data file to open as an input argument. Verify whether or not the file actually exists before trying to open it. The success or failure of this operation should be stored in a status variable. If the file exists, uses either the built-in dlmread or readmatrix functions to read the data from the file and store it in a variable, which will be a matrix. Otherwise, do not try reading the file, since MATLAB will flag that as an error and terminate your code. Returns the data variable and the status variable as output arguments. Is silent, meaning it does not prompt the user for input nor does it display anything.
2. Write a MATLAB function named AnalyzeData that: Accepts the data variable (which is a matrix) as an input argument. Keeps a count of how many times a failure occurred due to temperature, pressure, or dwell time excursions outside of the allowed limits. o Use a for loop and an if selection statement to process each batch (row) in the data variable. Note: Do NOT use the sum function to do this! Uses the accumulated counts to calculate the percentage failed for each of the conditions. Note: Do NOT use the mean function to do this! Returns the calculated percentages for temperature, pressure, and dwell time as output arguments. Is silent, meaning it does not prompt the user for input nor does it display anything. 3. Create a MATLAB driver script named hw4x2.m that: Prompts the user to enter the name of the data file. Calls your function ReadBatchData, passes it the data file name, and stores the returned data and status. Checks the status value. If the file could not be found, then the script should display an error message and terminate. Otherwise, it can proceed to the next step. Calls your function AnalyzeData, passes it the data variable, and stores the returned calculated percent failed values. Displays the calculated percentages (to one decimal place) due to temperature, pressure, or dwell time being out-of-spec. Displays a table showing each batch number and which conditions it passed and which it failed. o Use a for loop to process and print each line of the table. 2. Write a MATLAB function named AnalyzeData that: Accepts the data variable (which is a matrix) as an input argument. Keeps a count of how many times a failure occurred due to temperature, pressure, or dwell time excursions outside of the allowed limits. o Use a for loop and an if selection statement to process each batch (row) in the data variable. Note: Do NOT use the sum function to do this! Uses the accumulated counts to calculate the percentage failed for each of the conditions. Note: Do NOT use the mean function to do this! Returns the calculated percentages for temperature, pressure, and dwell time as output arguments. Is silent, meaning it does not prompt the user for input nor does it display anything. 3. Create a MATLAB driver script named hw4x2.m that: Prompts the user to enter the name of the data file. Calls your function ReadBatchData, passes it the data file name, and stores the returned data and status. Checks the status value. If the file could not be found, then the script should display an error message and terminate. Otherwise, it can proceed to the next step. Calls your function AnalyzeData, passes it the data variable, and stores the returned calculated percent failed values. Displays the calculated percentages (to one decimal place) due to temperature, pressure, or dwell time being out-of-spec. Displays a table showing each batch number and which conditions it passed and which it failed. o Use a for loop to process and print each line of the tableStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started