using the attache file for matrix. i am using for loop but i am making mistake some where.
My objective in the columns or rows should contains elements eithr 1 or 3 to generate a boundary of the sphere while the remaining elements should be zero.
For example, if in a row: 3 3 0 0 ... 1, i want first element or last element should be either 1 or 3 but other elments inside of the row or column should be zero. So it should be like: 3 0 0 0 .. 1
Any guidance please. Thanks in advance.
matrix = load('Boundary_closed_1s_3s.txt')
[m, n] = size(matrix)
For i = 1:m
for j = 1:n