subject
Engineering, 02.11.2019 04:31 kekebaby156

Create a function called randmatrix that takes input from the script and returns a mxn matrix v of random numbers (use rand). m and n must be chosen by the user on the script and passed to the function. display this matrix on the script.

use for loops to move through the v matrix, element by element, and change any value that is less than 0.5

to 0 and any value that is greater than (or equal to) 0.5 to 1.

display this matrix.

sample output:

enter number of rows: 3

enter number of columns: 5

original matrix v:

0.7275 0.7490 0.2483 0.9199 0.9567

0.5003 0.7374 0.3838 0.9002 0.6681

0.5233 0.8743 0.7914 0.7079 0.4669

new matrix v:

1 1 0 1 1

1 1 0 1 1

1 1 1 1 0

ansver
Answers: 3

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Manometers are good examples of measuring instruments, nowadays they are not as common as before. a)-capacitive probe gauges b)-gravitational gauges deformation ) gauges d)-digital gauges
Answers: 1
question
Engineering, 04.07.2019 18:10
Atmospheric air has a temperature (dry bulb) of 80° f and a wet bulb temperature of 60° f when the barometric pressure is 14.696 psia. determine the specific humidity, grains/lb dry air. a. 11.4 c. 55.8 d. 22.5 b. 44.1
Answers: 1
question
Engineering, 04.07.2019 18:20
Aquick transition of the operating speed of a shaft from its critical speed will whirl amplitude. (a) increase (b) limit (c) not affect (d) zero
Answers: 2
question
Engineering, 04.07.2019 18:20
Wiy doeres rere okhn a pump whon working betwon the same pressure range?
Answers: 2
You know the right answer?
Create a function called randmatrix that takes input from the script and returns a mxn matrix v of r...
Questions
question
Chemistry, 11.06.2021 06:40
question
Mathematics, 11.06.2021 06:40
Questions on the website: 13722367