Question: please write in matlab! A machine is designed to cut feeding materials into small parts. After each cut, the width and length of the part
please write in matlab!
A machine is designed to cut feeding materials into small parts. After each
cut, the width and length of the part are measured. These values are then stored in a data
file.
The enclosed partsdat and partsdat are two examples of such recorded files. Each row
in the data file stores the two measurements for each part: the width, followed with the
length.
Write a function to read in such a data file and count total number of parts stored in the
file and the number of rejected parts. A part is rejected if its area Area Width times Length
is greater than
The function shall have one input argument, which is the file path of the data file. The
function shall have two output arguments: number of rejects and total number of parts in
the file.
Requirement:
Please implement this function using forloop;
Read in data using importdata function.
Your function should produce the same outputs as below the exact values may vary due to
data change, but the format must be the same Please note if the partsdat and partsdat
are in the current folder with your function, we only need to use the file name instead of
the full file path.
AB CountRejectspartsdat'
A
B
RN CountRejectspartsdat'
R
N
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
