Nguyễn Tiến Dũng
New member
Create an array of logical values.
Find the cumulative product of the rows of A.
A.
B = 1 0 0
0 1 0
B.
B = 1 0 0
1 1 0
C.
B = 1 0 0
1 1 1
D.
B = 1 1 0
1 1 0
Code:
A = [true false true; true true false]
A = 1 0 1
1 1 0
B = cumprod(A,2)
A.
B = 1 0 0
0 1 0
B.
B = 1 0 0
1 1 0
C.
B = 1 0 0
1 1 1
D.
B = 1 1 0
1 1 0