Question: Workshop 2 1 solution submitted ( max: 5 ) | View my solutions nvalid Pipes ( Vectorized ) A machine cuts N pieces of a
Workshop
solution submitted max: View my solutions
nvalid Pipes Vectorized
A machine cuts pieces of a pipe. After each cut, each piece of pipe is weighed grams and its length meters is measured. These values are then stored in a file called MEPipeData.mat see Canvas NOTE: In MATLAB Grader, this data file is provided but you still need to load it
Invalid Pipes Loops
Gravity
The weight is supposed to be between has an invalid weight andor length.
Develop a MATLAB script which returns:
numinvalid, the total number of invalid pipes
invalidpipes, a row vector storing the indices of invalid pipes
For example, consider the following data:
weight ;
lngth ;
Pipe is invalid because its weight is too low despite its length being acceptable
Pipe is valid.
Pipe is invalid because both its weight and height violate the boundaries
Thus:
numinvalid ;
invalidpipes ;
For this problem, you must vectorize! No decisionrepetition structures! bar and yline functions may be useful visualization tools.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
