Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The given file: Do this in Matlab, please! Thank you! Instructions: Complete Problem 1 and Problem 2 below. Create a single script (.m file) to
The given file:
Do this in Matlab, please!
Thank you!
Instructions: Complete Problem 1 and Problem 2 below. Create a single script (.m file) to complete this assignment. Unless directed otherwise, use meaningful variable names for each variable; do not use the default variable ans to store your results. For this assignment suppress your output with semi-colons (;). Each problem (i.e. Problem 1 and Problem 2) should be in a separate cell, using the cell mode feature of MATLAB; the subparts should all be contained in the same cell as the parent problem. Please remember to follow the Programming Style Convention on Canvas. When complete, please submit your code to the dropbox on Canvas; the grader will run it to view your output. Name your file like this: username_assignment7.m (example: bjs5332_assignment7.m). Your submission must be a single .m file. Complete Problem 1 and Problem 2 below. Create a single script (.m file) to complete this assignment. Unless directed otherwise, use meaningful variable names for each variable; do not use the default variable ans to store your results. For this assignment suppress your output with semi-colons (;). Each problem (i.e. Problem 1 and Problem 2) should be in a separate cell, using the cell mode feature of MATLAB; the subparts should all be contained in the same cell as the parent problem. Please remember to follow the Programming Style Convention on Canvas. When complete, please submit your code to the dropbox on Canvas; the grader will run it to view your output. Name your file like this: username_assignment7.m (example: bjs5332_assignment7.m). Your submission must be a single.m file. Problems: 1. You are working on a manufacturing process at a summer internship. For a specific manufacturing process, a given part is produced 25 units at a time. The machine outputs a CSV file with a measurement of how close each part in a batch was to the required specification; positive numbers indicate that the unit was X c.m. longer than the specification, while negative numbers indicate that the unit was X c.m. shorter than the required specification. If any part in a batch of 25 parts is 0.5 cm (or more) longer, or 0.5 cm (or more) shorter, than the required specification, then the entire batch of 25 parts must be rejected and the operator notified to check the manufacturing machinery. If all of the parts are acceptable, then the operator should be notified that the batch was acceptable. Read about the readmatrix( ) command in the MATLAB help documentation, then use it to programmatically load in the data from this data file. (There are a lot of bells-and-whistles available with readmatrix(), but the first syntax example noted in the help documentation is all that you need here.) Then, use a while loop to loop through each individual data point (one data point per iteration) to check to see if the part met the manufacturing specifications. If it did, print a statement to the screen indicating that. If it did not, print a Then, use a while loop to loop through each individual data point (one data point per iteration) to check to see if the part met the manufacturing specifications. If it did, print a statement to the screen indicating that. If it did not, print a statement to the Command Window indicating that, and terminate your part-checking process. After you are done with the checking process, print a message to the Command Window indicating the outcome from that batch of parts. Your code should be able to emulate the sample runs below, even if the provided CSV file's data only meets one of these two sample run conditions. Observe that there is space for a two digit numeric output; your code should preserve that spacing. -0.43 -0.26 -0.14 0.31 -0.47 -0.45 -0.32 0.15 0.23 0.14 -0.05 0.05 -0.2 0.24 -0.3 0.18 -0.31 -0.13 0.12 0.27 0.53 -0.41 0.42 0.27 -0.01 Sample Run #1: All parts were satisfactory. Part No. 1 was made to specification. Part No. 2 was made to specification. Part No. 3 was made to specification. Part No. 4 was made to specification. Part No. 5 was made to specification. Part No. 6 was made to specification. Part No. 7 was made to specification. Part No. 8 was made to specification. Part No. 9 was made to specification. Part No. 10 was made to specification. Part No. 11 was made to specification. Part No. 12 was made to specification. Part No. 13 was made to specification. Part No. 14 was made to specification. Part No. 15 was made to specification. Part No. 16 was made to specification. Part No. 17 was made to specification. Part No. 18 was made to specification. Part No. 19 was made to specification. Part No. 20 was made to specification. Part No. 21 was made to specification. Part No. 22 was made to specification. Part No. 23 was made to specification. Part No. 24 was made to specification. Part No. 25 was made to specification. There were no issues with this batch of parts. Sample Run #2: The fourth part did not meet the required specification. Part No. Part No. 1 was made to specification. 2 was made to specification. 3 was made to specification. 4 was NOT made to specification. Part No. Part No. The manufacturing process needs adjusted. Hints: 1. A do while loop-like process may be helpful here. 2. There is a very helpful typefield available to help you with ensuring that the printing is as "short" as possible. We have not used this typefield much so far, so reference Slide 17 of Lecture 09Step 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