# introduction to programming with matlab - Vanderbilt University week-9 assignment 4 solutions

## Image Blur

These solutions are for reference only.

It is recommended that you should solve the assignment and quiz by yourself honestly then only it makes sense to complete the course.

but if you cant figure out some part of it than you can refer these solutions

make sure you understand the solution

dont just copy paste it

-----------------------------------------

## blur.m

function [output] = blur(A, w) [rows, columns] = size(A); B = nan(size(A) + 2 * w); B(w + 1 : end - w, w + 1 : end - w) = A; output = 0 * A; for i = w + 1 : rows + w for j = w + 1 : columns + w tmp = B(i - w : i + w, j - w : j + w); output(i - w, j - w) = mean(tmp(~isnan(tmp))); end end

main course : https://www.coursera.org/learn/matlab