In: Computer Science
matrix = [5,2,8;6,7,20;10,25,9]
wro = 20
function output = remove_row(matrix, wro)
n_rows = size(matrix, 1)
n_cols = size(matrix, 2)
output = []
count = 0
for r = 1:n_rows
flag = 0
for c = 1:n_cols
if(matrix(r,c) == wro)
flag = 1
end
end
if(flag == 0)
count = count + 1
output = [output count]
end
end
end
remove_row(matrix, wro)
If you have any doubts please comment and please don't dislike.