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, 03.07.2019 14:10
Amass of 1.5 kg of air at 120 kpa and 24°c is contained in a gas-tight, frictionless piston-cylinder device. the air is now compressed to a final pressure of 720 kpa. during the process, heat is transferred from the air such that the temperature inside the cylinder remains constant. calculate the boundary work input during this process.
Answers: 2
question
Engineering, 04.07.2019 18:10
Afull journal bearing has a journal diameter of 27 mm, with a unilateral tolerance of -0.028 mm. the bushing bore has a diameter of 27.028 mm and a unilateral tolerance of 0.04 mm. the l/d ratio is 0.5. the load is 1.3 kn and the journal runs at 1200 rev/min. if the average viscosity is 50 mpa-s, find the minimum film thickness, the power loss, and the side flow for the minimum clearance assembly.
Answers: 1
question
Engineering, 04.07.2019 18:10
Which from the following instrument is commonly used to detect the high pitch butzing sound in bearings? [clo4] a)-digital ultrasonic meter b)-infrared camera c)-spectroscopic d)-vibrometer
Answers: 2
question
Engineering, 04.07.2019 19:10
What is a monomer? how do they form a ploymer from the view point of chemical bonding?
Answers: 1
You know the right answer?
Selecting random elements from an array. Assign selectedValues with numberSelected randomly selecte...
Questions
question
SAT, 17.02.2021 22:20
question
Social Studies, 17.02.2021 22:20
question
Chemistry, 17.02.2021 22:20
question
Mathematics, 17.02.2021 22:20
question
Mathematics, 17.02.2021 22:20
Questions on the website: 13722363