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, 03.07.2019 14:10
When at a point two solid phase changes to one solid phase on cooling then it is known as a) eutectoid point b) eutectic point c) peritectic point d) peritectoid point
Answers: 3
question
Engineering, 04.07.2019 18:10
Refrigerant 134a enters an insulated compressor operating at steady state as saturated vapor at -26°c with a volumetric flow rate of 0.18 m3/s. refrigerant exits at 9 bar, 70°c. changes in kinetic and potential energy from inlet to exit can be ignored. determine the volumetric flow rate at the exit, in m3/s, and the compressor power, in kw.
Answers: 1
question
Engineering, 04.07.2019 18:10
The drive force for diffusion is 7 fick's first law can be used to solve the non-steady state diffusion. a)-true b)-false
Answers: 1
question
Engineering, 04.07.2019 18:10
You are making beer. the first step is filling the glass carboy with the liquid wort. the internal diameter of the carboy is 15 in., and you wish to fill it up to a depth of 2 ft. if your wort is drawn from the kettle using a siphon process that flows at 3 gpm, how long will it take to fill?
Answers: 1
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
Mathematics, 28.08.2019 19:30
Questions on the website: 13722363