I need a fast and efficient code for the following problem:
Suppose I have matrix m and m2m:
m = [3;4;5;-1;2;-4];
m2m2 = [-2;-5;-6;-3;-8;-1];
I need to find all positive value in matrix m or in matrix m2m, and then, select randomly one value among of them. Note that, matrix m and m2m can't be positive at the same time.
This random selection is index of matrix array. For example, if array 4 is randomly selected in matrix m, then I need results to be 2 (2 means second array(index)).