I have two columns in Table A, the first column is randomly generats values between 10 and 3600 but the second column needs to be randomly generated based on the first columns values. The second column needs to be a value equal to or less than column 1's equivalent row and if the random value is lower and not equal to it, it must be divisible by traffic.R_P.
I tried the below for loop but of course it is generating random numbers not divisible by traffic.R_P. Not sure how to create a controlled random generator with values divisible by another column.
traffic.R_P = [2500 1200 200 400]
traffic.XX = [2500 60 0 10]
traffic.XX = [2400 60 1100 300]
traffic.R_P = randi([1,36],TDT_Total_ID,1)*100;
for T_row = 1 : TDT_Total_ID
traffic.XX(R_dith_row,1) = randi([1,(traffic.R_D(T_row,1)/10)],T_row,1)*10;