IF i have this matrix
A=[ 3 2 0 2 1 1 5 4 0 3 2 0 4 3 1 10 0 0 ]
and i found this matrix
a = [ 5 4 9 5 8 10 ]
and this matrix
b = [2 3 2 2 3 1 ]
i want to find this matrix F_Complete where for k=1:6 if (a(k) + b(k) – 1) == 10 then go back to A(k) and make group of ones depend on the number in the row(k) ( between each group there is zero ) like this
the third row in A = [5 4 0 ] make the condition true then
F_Complete(3,:) = [1 1 1 1 1 0 1 1 1 1]
the five row in A = [ 4 3 1 ] make the condition true then
F_Complete(5,:) = [1 1 1 1 0 1 1 1 0 1]
the last row in A = [ 10 0 0] make the condition true then
F_Complete(6,:) = [1 1 1 1 1 1 1 1 1 1]
then the final answer is
F_Complete = [ 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 0 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 ]
Best Answer