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

Other questions on the subject: Engineering

image
Engineering, 03.07.2019 19:30, 10040813
When using the ohmmeter function of a digital multimeter, the leads are placed in what position relative to the component being tested? a. parallel b. control c. series d. line
Answers: 3
image
Engineering, 04.07.2019 18:10, agpraga23ovv65c
Carbon dioxide gas expands isotherm a turbine from 1 mpa, 500 k at 200 kpa. assuming the ideal gas model and neglecting the kinetic and potential energies, determine the change in entropy, heat transfer and work for each kilogram of co2.
Answers: 2
image
Engineering, 04.07.2019 18:20, hayleymckee
Steam enters a converging nozzle at 3.0 mpa and 500°c with a at 1.8 mpa. for a nozzle exit area of 32 cm2, determine the exit velocity, mass flow rate, and exit mach number if the nozzle: negligible velocity, and it exits (a) is isentropic (b) has an efficiency of 94 percent
Answers: 2
image
Engineering, 04.07.2019 18:20, sanchez626
Aheavily insulated piston-cylinder device contains 0.02 m3 of steam at 300 kpa and 200 °c. 1.2 mpa. d this process. team is now compressed in a reversible manner to a pressure of etermine the entropy change and the work done on the steam during this process
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 in other subjects:

Konu
Mathematics, 21.10.2019 20:00
Konu
Advanced Placement (AP), 21.10.2019 20:00