MATLAB: How to select a number randomly from a series of fixed number MATLAB hi i have a series of numbers and i want to select one of them randomly . ie a=[10 3 4 2 5] ans: 3 and at every time this may change to new number among them. kindly help in this regard. i will b highly thankful to you Regards Best Answer >> a(randi(numel(a)))In other words, pick a random (integer) number N between 1 and the number of elements in "a", then return the Nth element of "a". Related SolutionsMATLAB: Random numbers help randdoc rand MATLAB: Random number time series ln = 100; % length of timeseriesTs = 1; % timestepfor k = 1:ln tmp_mean = 2+2*(k-1)/(ln-1); % your linearly increasing mean tmp_devi = 1; % your constant standard deviation x(k,1) = random('norm',tmp_mean,tmp_devi,1,1);endtimeseries = iddata(x,[],Ts); Related QuestionRandom number with fixed summationHow to generates random numbersFixed PointHow to find random number between 20 input numbers
Best Answer