Please Do this in MATLAB not C++ and please type out the code Here is that sutur
ID: 1766059 • Letter: P
Question
Please Do this in MATLAB not C++ and please type out the code
Here is that suture file
Suture.dat
Problem-1: Suture Packaging 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 object that seals the package is referred to as a sealing die. Generally, sealing dies are heated with an electric heater. For the sealing process to be a success, the sealing die is maintained at an established temperature and must contact the package with a predetermined pressure for an established time period. The time period in which the sealing die contacts the package is called the dwell time. Assume that the acceptable ranges of parameters for an acceptable seal are the following: Temperature 150-170°C Pressure: DwellTime: 2-2.5s 60-70 psi (pound per square inch) A data file named suture.dat contains information on batches of sutures that have been rejected during a week period. Each line in the data file contains the batch number, the temperature, the pressure, and the dwell time for a rejected batch. As a quality control engineer, your goal is to analyze this information to determine the percentage of batches rejected due to temperature, the percentage rejected due to pressure, and the percentage rejected due to dwell time. If a specific batch is rejected for more than one reason, it should be counted in all applicable totals. 1. Create a MATLAB Script to compute and print the percentage and the total number of batches rejected in each category- 2. Some of the batches were erroneously rejected. Provide the commands to determine those batches, return their batch numbers and the total number of batches that should have actually been rejected. 3. Create a data file that contains the batches that were erroneously rejected. 4. Some of the batches have duplicate entries (i.e. have the same values for temperature, pressure, and dwell time) . Provide the commands to find the number of duplicate entries and the batch numbers of th entries that have been duplicatedExplanation / Answer
MATLAB Code:
S11=load('Suture.dat')
RejTempCnt = 0
RejPrCnt = 0
RejDwTCnt = 0
ErrRejCnt = 0
DupEnCnt = 0
BatchNo = S11(:,(1))
Temp = S11(:,(2))
Presu = S11(:,(3))
DwT = S11(:,(4))
RejTotal = 30
%%%%%%%count the rejected in Temperature
for i =1:30
if((Temp(i) <150.0) || (Temp(i) > 170.0))
RejTempCnt = RejTempCnt+1;
end
end
display(RejTempCnt)
PerRejTempCnt = (RejTempCnt/RejTotal) * 100
display(PerRejTempCnt)
%%%%%%%count the rejected in Pressure
for i =1:30
if((Presu(i) <60.0) || (Presu(i) > 70.0))
RejPrCnt = RejPrCnt+1;
end
end
display(RejPrCnt)
PerRejPrCnt = (RejPrCnt/RejTotal) * 100
display(PerRejPrCnt)
%%%%%%%count the rejected in Pressure
for i =1:30
if((DwT(i) <2.0) || (DwT(i) > 2.5))
RejDwTCnt = RejDwTCnt+1;
end
end
display(RejDwTCnt)
PerRejDwTCnt = (RejDwTCnt/RejTotal) * 100
display(PerRejDwTCnt)
%%%%%%%count the rejected items erroneously and write into file xdata.dat
fid = fopen ('xdata.dat', 'w');
for i =1:30
if(((Temp(i) >= 150.0) && (Temp(i) <= 170.0))&&((Presu(i) >= 60.0) && (Presu(i) <= 70.0))&&((DwT(i) >= 2.0) && (DwT(i) <= 2.5)))
ErrRejCnt = ErrRejCnt+1;
display(BatchNo(i))
fprintf (fid, '%d', BatchNo(i));
fprintf (fid, ' ');
end
end
display(ErrRejCnt)
%%%%Duplicate entries
for i = 1:29
for j = i+1:30
if((Temp(i) == Temp(j))&&(Presu(i) == Presu(j))&&(DwT(i) == DwT(j)))
DupEnCnt = DupEnCnt+1;
end
end
end
display(DupEnCnt)
Commandwindow:
>> Suture_cnt
S11 =
1.0e+04 *
2.4551 0.0146 0.0062 0.0002
2.4582 0.0154 0.0063 0.0003
2.5132 0.0121 0.0090 0.0001
2.6553 0.0160 0.0059 0.0003
2.6613 0.0159 0.0059 0.0002
2.6615 0.0160 0.0060 0.0002
2.6619 0.0150 0.0069 0.0002
2.6624 0.0160 0.0062 0.0002
2.7725 0.0171 0.0063 0.0003
2.8151 0.0160 0.0040 0.0002
2.8189 0.0160 0.0040 0.0002
2.9551 0.0170 0.0049 0.0003
3.0003 0.0160 0.0059 0.0003
3.1503 0.0165 0.0068 0.0002
3.2553 0.0146 0.0062 0.0002
3.5001 0.0156 0.0067 0.0002
3.7191 0.0170 0.0060 0.0003
3.8091 0.0179 0.0090 0.0003
3.9099 0.0162 0.0090 0.0004
3.8091 0.0150 0.0060 0.0002
4.0099 0.0165 0.0067 0.0002
4.1091 0.0155 0.0060 0.0002
4.2000 0.0205 0.0075 0.0002
4.3001 0.0255 0.0060 0.0002
4.5500 0.0025 0.0055 0.0003
4.8000 0.0255 0.0070 0.0002
5.5500 0.0160 0.0060 0.0004
5.8000 0.0165 0.0070 0.0002
5.5555 0.0165 0.0060 0.0002
6.8000 0.0175 0.0070 0.0002
RejTempCnt =
0
RejPrCnt =
0
RejDwTCnt =
0
ErrRejCnt =
0
DupEnCnt =
0
BatchNo =
24551
24582
25132
26553
26613
26615
26619
26624
27725
28151
28189
29551
30003
31503
32553
35001
37191
38091
39099
38091
40099
41091
42000
43001
45500
48000
55500
58000
55555
68000
Temp =
145.5000
153.7000
120.5000
160.4000
159.5000
160.0000
150.3000
160.5000
170.9000
160.3000
160.3000
170.1000
160.4000
165.1000
145.5000
155.5000
170.0000
179.0000
162.0000
150.0000
165.0000
155.0000
205.0000
255.0000
25.0000
255.0000
160.0000
165.0000
165.0000
175.0000
Presu =
62.3000
63.0000
90.3000
58.8000
58.9000
60.0000
69.3000
61.5000
62.5000
40.2000
40.2000
49.3000
58.8000
68.2000
62.3000
67.3000
60.0000
90.0000
90.0000
60.0000
67.0000
60.0000
75.0000
60.0000
55.0000
70.0000
60.0000
70.0000
60.0000
70.5000
DwT =
2.1300
2.5200
1.3100
2.5100
2.0200
2.2000
2.4000
1.9800
2.8300
2.1900
2.1900
3.1900
2.5100
2.1200
2.1300
2.1300
2.5000
2.5000
4.5000
2.0000
1.8500
2.1000
1.8500
2.1000
2.8500
2.1000
3.8500
2.1000
2.0500
2.1000
RejTotal =
30
RejTempCnt =
11
PerRejTempCnt =
36.6667
PerRejTempCnt =
36.6667
RejPrCnt =
12
PerRejPrCnt =
40
PerRejPrCnt =
40
RejDwTCnt =
12
PerRejDwTCnt =
40
PerRejDwTCnt =
40
ans =
26615
ans =
26619
ans =
31503
ans =
35001
ans =
37191
ans =
38091
ans =
41091
ans =
58000
ans =
55555
ErrRejCnt =
9
DupEnCnt =
3
>>