I have a matrix(6 by 3) of different row lengths:
0.9969 0.9724 0.3951 0.3590 0.5865 0.3983 0.6252 0.7780 0.7513 NaN 0.7277 0.5224 NaN NaN 0.4904 NaN NaN 0.0887
and a logical index matrix that has same or longer row length(7 by 3) like:
1 0 1 1 1 1 0 1 0 0 0 1 0 1 1 0 1 1 1 0 1
how can I get the following results(7 by 3) without loop:
0.9969 0 0.3951 0.3590 0.9724 0.3983 0 0.5865 0 0 0 0.7513 0 0.7780 0.5224 0 0.7277 0.4904 0.6252 0 0.0887
Thanks very much in advance
Best Answer