subject
Engineering, 14.11.2019 06:31 mia3128

Write a function, in the programming language of your choice, which finds contiguous regions (or "islands") in a matrix where all values in the island are greater than a threshold (but not necessarily the same). the function should take a threshold, a minimum island size, and an arbitrarily sized matrix as inputs. the function should output a matrix (same size as the input matrix) of booleans. do not wrap around matrix edges. corner neighbors are not sufficient for island continuity. for example, if the the inputs are: threshold = 5, min island size = 3, and matrix = [4, 4, 4, 2, 2; 4, 2, 2, 2, 2; 2, 2, 8, 7, 2; 2, 8, 8, 8, 2; 8, 2, 2, 2, 8]. then the output would be [0, 0, 0, 0, 0; 0, 0, 0, 0, 0; 0, 0, 1, 1, 0; 0, 1, 1, 1, 0; 0, 0, 0, 0, 0].

ansver
Answers: 3

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Draw the engineering stress-strain curve for (a) bcc; (b) fcc metals and mark important points.
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
question
Engineering, 04.07.2019 18:10
Which one from below is not one of the reasons of planning failures? (clo3) a)-planner is careless. b-planner spend less time in the field but more time on the desk c)-planner is not qualified d)-planner does not have sufficient time to properly plan
Answers: 3
question
Engineering, 04.07.2019 18:10
Water at the rate of 1 kg/s is forced through a tube with a 2.5 cm inner diameter. the inlet water temperature is 15°c, and the outlet water temperature is 50°c. the tube wall temperature is 14°c higher than the local water temperature all along the length of the tube. what is the length of the tube?
Answers: 3
You know the right answer?
Write a function, in the programming language of your choice, which finds contiguous regions (or "is...
Questions
question
Mathematics, 29.04.2021 06:10
question
Mathematics, 29.04.2021 06:10
question
Arts, 29.04.2021 06:10
question
Mathematics, 29.04.2021 06:10
question
Mathematics, 29.04.2021 06:10
Questions on the website: 13722367