Assignment ML-2: Intermediate Level Matlab Practice with Logic! General Program Requirements: • Proper planning using pseudo code or flow chart • Top-of-programs contain comment that includes:...

1 answer below »
please explain how it was done


Assignment ML-2: Intermediate Level Matlab Practice with Logic! General Program Requirements: • Proper planning using pseudo code or flow chart • Top-of-programs contain comment that includes: author’s name & date • Comments at appropriate points in code! Problem 1 - “Largest and Smallest Numbers” Write a program that loads a 6 x 24 array of integers from a data file and then outputs the largest and the smallest values for each row onto the console in a full sentence. You may not use the built-in max and min functions. Start by creating a flowchart or pseudo code in a computer program (draw.io or other.) The input file is on Canvas. Input File Name: Largest_and_Smallest_Numbers.txt Name your file: LastName_ML2_L2S.m Your output should look like this: Screen shot your finished command prompt Problem 2 – “Sutures” 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 to prevent contamination. The packages are sealed on a machine with a sealing die. For the sealing to be a success, the die must be maintained at an established temperature, and contact the package with a predetermined pressure for an established time period. This time period is called the dwell time. The acceptable ranges for these three conditions are as follows: Temperature: 150-170° C Pressure: 60-70 psi Dwell Time: 2-2.5 sec Write a program that reads in a file containing data of 24 batches of rejected sutures. Start by creating a flowchart or pseudo code in a computer program (draw.io or other.) Input File Name: Batch_Data.txt Each line of the file contains a batch number, temperature, pressure and dwell time for a batch. As the Quality Control Engineer, you need to analyze the data and compute: • Number of batches rejected due to temperature, pressure, and dwell time. • Percent of batches rejected due to temperature, pressure, and dwell time. • Total number and Percent of failed batches. If a specific batch was rejected in more than one category, it should be counted in all of the applicable totals. Any failure in a specific category counts as a specific category failure and also makes the batch fail overall. However, do not ‘double count’ batch failures, if a batch fails for more than one reason. Name your file: LastName_ML2_Sutures.m Your output should look like this: Screen shot your finished command prompt Create a PDF containing: • Both flow charts/ pseudo code • Both screenshots (make sure to label all your screenshots/figures!) RUBRIC Points Upload ALL files to Canvas with correct names. (1 PDF + 2 .m files) 5 Program 1: Largest to Smallest File runs without errors and returns correct values. 15 Has a clean formatting in command prompt 5 Is commented with clear comments that help the user understand the logic of this code. Contains name and date. 10 Included a flow chart or pseudo code 5 Screen shot of finished command prompt 5 Program 2: Sutures File runs without errors and returns correct values. 30 Has a clean formatting in command prompt 5 Program Clarity • Commented with clear comments that help the user understand the logic of this code • First comments contain student’s name and date. • Formatted appropriately (indentations/parentheses) 10 Included a flow chart or pseudo code 5 Screen shot of finished command prompt 5 Total 100 BONUS CHALLENGE (WORTH 3 POINTS IF SUCCESSFUL) The following challenge is optional for students looking to challenge themselves. • Change Problem #2 to track the ID# of the failed batches • Print the failed batches to the screen in rows of 5 (get creative!) • Save the file as LastName_ML2_Bonus.m and upload this in place of sutures • Your new command prompt should look like this: ML-2: Intermediate Level Matlab Practice with Logic! 982975651174696730422184019254691344164761057144190817409819591836105519151113347 97149112691326101915043846320889810283448891852321729379241218126080612392831821 601445672162013091174123163095717116434241406142014007988531616597232154416291423818 167717081201685151913951909138516901074172927917745261284540157975104916245407715203 6281185870128032919941015398191370420576867173381795500594304158193215349211911 1954170050210483690883434152518531000832157310641804124016141147805390153812719081947 24551145.562.32.13 24582153.7632.52 26553160.458.82.51 26613159.558.92.02 26624160.561.51.98 27725170.962.52.03 27832147.865.62.12 27976155.4712.34 28061162.757.92.61 28251171.359.22.23 28347164.8652.45 28782152.858.62.05 28788167.267.31.89 29192149.660.92.26 2922717267.82.33 29482155.273.12.47 29522148.572.12.27 29617168.349.72.63 29785169.464.41.87 29885146.655.92.42 29943170.366.82.31 29957166.356.82.11 29968162.864.62.68 29987149.269.72.22
Answered 1 days AfterFeb 05, 2021

Answer To: Assignment ML-2: Intermediate Level Matlab Practice with Logic! General Program Requirements: •...

Rahul answered on Feb 07 2021
147 Votes
>> fid=fopen('batchdata.txt','rt');
oneline=fgets(fid);
a=1;
while ischar(oneline)
one(a,1:4)=st
r2num(oneline);
oneline=fgets(fid);
a=a+1;
end
>> b=1;
tempr=0;
while b<25
if one(b,2)<150 || one(b,2)>170
tempr=tempr+1;
else
end
b=b+1;
end
d=1;
presr=0;
while d<25
if one(d,3)<60 ||...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here