from give matrix (attached), i am using following code to close the surface and to make a boundary but i am getting errors that indexing is out of bound.
m = zeros(28) m = load('Matrix_Boundary_fills_3s_only.txt');[rows, colms] = size(m);mOut = m;for row = 2 : rows %
for colm = 1:colms if m(row-1, colm) == 3 mOut(row, colm+1) = 3; end if m(row-1, colm) == 3 || m(row-1,colm+2) == 3 mOut(row, colm+1) = 3; end if m(row-1, colm + 1) == 3 mOut(row, colm+1) = 3; end end end % end
disp(mOut)
thanks for all cooperation in advance.
Best Answer