my implement: ? Load the data ? Iteratively check each of the surface area value
ID: 3654501 • Letter: M
Question
my implement: ? Load the data ? Iteratively check each of the surface area values ? Determine the bacteria classification of each surface area value (e.g., Low, High, etc.) using an if/elseif statements ? Count the number of dishes of each bacteria classification ? Print out a message for each category with the final count for that category
****WHAT DO I WRITE IN THE MATLAB SCRIPT FILE BASED ON MY IMPLEMENT?*****
Bacteria Classification
Surface Area Covered by Bacteria (in2)
Low
x < 2.5
Medium-Low
2.5<=x < 4.5
Medium
4.5<=x < 6.5
Medium-High
6.5<=x < 8.5
High
8.5 <= x
Bacteria Classification
Surface Area Covered by Bacteria (in2)
Low
x < 2.5
Medium-Low
2.5<=x < 4.5
Medium
4.5<=x < 6.5
Medium-High
6.5<=x < 8.5
High
8.5 <= x
Explanation / Answer
You have not given data format. So suppose data is in an array surf[]. surf=[1.5, 2,2.6,2.8,3, 1.9,9, 6, 6.2,7, 7.5]; n=size(surf) low=0; medlow=0; med=0; medh=0; hig=0; for i=1:n(1,2) if surf(i)=2.5 & surf(i)=4.5 & surf(i)=6.5 & surf(i)=8.5 hig=hig+1; end end fprintf('Low: %d Medium-Low: %d Medium : %d Medium-high: %d High : %d ',low,medlow,med,medh, hig); Output: Low: 3 Medium-Low: 3 Medium : 2 Medium-high: 2 High : 1Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.