Elements of matrix B are row numbers of matrix A. The row number of matrix A start from 0. Matrix A has several zero rows.
produce matrix C:
when an element of matrix B refer to a zero row of matrix A, the row of matrix B should be replaced with zero.
For instance, I would like to produce Matrix C.
A = 0.0 0.0 0.4 0.8 0.0 0.0 0.2 0.6 B= 1 0 0 2 3 1 2 3 2 1 C= 0 0 0 0 3 1 0 0 0 0
Best Answer