Hello guys,
I have an issue with the function RANDOM that is not producing random numbers as it should. Here is the code:
for j=1:25random(j, 1)=rand*(time(j, 1)/2);random(j, 2)=rand*(time(j, 1)/2);random(j, 3)=rand*(time(j, 1)/2);end
If I input this in the command window and assign a value to "time", it works, but in my script, I am always getting the same number on every column! I tried to debug it with breakpoints, but I cannot see why from one line to the other, the "rand" function cannot produce random numbers.
Also inside this for loop, I then have different assignments to the time matrix, eg: time(j, 2) or time(j, 3) so it is not ok to just generate random numbers. I have to connect them with specific entries of the time matrix.
Best Answer