subject
Engineering, 27.01.2021 09:00 yulimariu27

Selecting random elements from an array. Assign selectedValues with numberSelected randomly selected elements from row array dataSet. Duplicate selections are acceptable. Hint: Use the randi function and an indexing array.
Ex: If numberSelected is 3 and dataSet is (74, 13, 1, 51, 6 ), then selectedValues might return [ 1, 74, 13 ].
Note: Successive "Runs' with the same arguments may return different results due to the random number generation. The ''Submit for Assessment' tests are configured to produce the same random numbers.
Function 0
Save 0 Reset â–  MATLAB Documentation
1 function selectedValues selectRandom( dataSet, numberSelected ) 2 selectRandom: Return numSel elements of input array data selected at 3 % random. Duplicate selections are acceptable. 4 % Inputs: data - array of input data values 5 % numSel - number of randomly selected elements to return 6 % 7 % Outputs: selected - array of randomly selected data values 8 9 % Choose randomly selected elements for output. 10 11 12 end 13
Code to call your function
selectRandom([ 74, 13, 1, 51, 6 ], 3)


Selecting random elements from an array.

Assign selectedValues with numberSelected randomly selec

ansver
Answers: 1

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Ajournal bearing has a journal diameter of 3.250 in with a unilateral tolerance of 20.003 in. the bushing bore has a diameter of 3.256 in and a unilateral tolerance of 0.004 in. the bushing is 2.8 in long and supports a 700-lbf load. the journal speed is 900 rev/min. find the minimum oil film thickness and the maximum film pressure for both sae 20 and sae 20w-30 lubricants, for the tightest assembly if the operating film temperature is 160°f. a computer code is appropriate for solving this problem.
Answers: 3
question
Engineering, 04.07.2019 18:10
Condition monitoring is a major component of. (clo4) a)- predictive maintenance. b)-preventive maintenance c)-proactive maintenance d)-reactive maintenance.
Answers: 1
question
Engineering, 04.07.2019 18:20
For a gate width of 2 m into the paper, determine the force required to hold the gate abc at its location.
Answers: 1
question
Engineering, 04.07.2019 19:10
The air in an automobile tire with a volume of 0.015 m3 is at 32°c and 140 kpa gage. determine the amount of air that must be added to raise the pressure to the recommended value of 206 kpa gage. assume the atmospheric pressure to be 128 kpa and the temperature and the volume to remain constant.[r-0.287 kj/kgk]
Answers: 3
You know the right answer?
Selecting random elements from an array. Assign selectedValues with numberSelected randomly selecte...
Questions
question
English, 11.09.2019 19:10