![subject](/tpl/images/cats/User.png)
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)
![ansver](/tpl/images/cats/User.png)
Answers: 1
![](/tpl/images/ask_question.png)
![](/tpl/images/ask_question_mob.png)
Another question on Engineering
![question](/tpl/images/cats/User.png)
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](/tpl/images/cats/User.png)
Engineering, 04.07.2019 18:10
Journeyman training is usually related (clo2) a)-to specific tasks b)-to cost analysis of maintenance task c)-to control process to ensure quality d)-to installation of machinery
Answers: 2
![question](/tpl/images/cats/User.png)
Engineering, 05.07.2019 10:10
What is the correct way to measure the overall length of a boat? measure from the tip of the bow to the highest point on the gunwale. measure from the tip of the bow in a straight line to the stern of the boat. measure from the tip of the bow in a straight line to the back seat. measure from port to starboard at the boat's widest point.
Answers: 1
![question](/tpl/images/cats/User.png)
Engineering, 06.07.2019 03:30
The load on a bolt consists of an axial pull of 10 kn together with a transverse shear force of 5 kn. the bolt material has a yield strength of syt syc 100 mpa. find the diameter of the bolt at factor of safety n-0.5, n 1 and n-2 using maximum shear stress theory
Answers: 3
You know the right answer?
Selecting random elements from an array.
Assign selectedValues with numberSelected randomly selecte...
Questions
![question](/tpl/images/cats/mat.png)
Mathematics, 12.05.2021 04:20
![question](/tpl/images/cats/himiya.png)
Chemistry, 12.05.2021 04:20
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/obshestvoznanie.png)
Social Studies, 12.05.2021 04:20
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/istoriya.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 12.05.2021 04:20
![question](/tpl/images/cats/mat.png)
Mathematics, 12.05.2021 04:20
![question](/tpl/images/cats/istoriya.png)
History, 12.05.2021 04:20
![question](/tpl/images/cats/mat.png)
Mathematics, 12.05.2021 04:20
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/istoriya.png)
History, 12.05.2021 04:20
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/biologiya.png)
![question](/tpl/images/cats/mat.png)