Question: Using MATLAB Software and without for or if statements killbacteria _ 2 d Consider an experiment where bacteria are grown on a petri dish divided

Using MATLAB Software and without for or if statements
killbacteria_2d
Consider an experiment where bacteria are grown on a petri dish divided into an R-by-C grid. Let matrix M(with R rows, C columns) represent the number of bacteria in each block of this grid. When a drop of antibiotic is delivered to a specific block at row x and column y, it kills all of the bacteria on that block and half of the bacteria in all of the neighboring blocks. The figure below shows an example of a plate composed of a 4-by-4 grid, where the numbers represent bacteria count in each block. After the antibiotic is delivered to the block at 2nd row and 3 th column, it kills all of the 10 bacteria on that block and half of the bacteria in neighboring blocks: 2+3+13+11+8+7+6+122=31; killing a total of 41 bacteria.
Write a function killbacteria(M,x,y that returns the total number of bacteria killed.
25
>> disp(killbacteria2d([162313; 511108],1,4))
23.5
\table[[16,2,3,13],[5,11,10,8],[9,7,6,12],[4,14,15,1]]
\table[[16,1,1.5,6.5],[5,5.5,0,4],[9,3.5,3,6],[4,14,15,1]]
Using MATLAB Software and without for or if

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!