1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Genrish500 [490]
3 years ago
13

Write a function that iteratively appends random 1's and 0's to an array to form a binary number. The function returns the binar

y result when it's decimal equivalent is larger than the input number. [outArray] = potd11(inputNumber)
Computers and Technology
1 answer:
Anestetic [448]3 years ago
7 0

Answer:

function [result] = potd11(userInput)

result = [0];

d = 0;

while d < userInput

result = [result, randi([0,1])];

d = sum(result .* (2.* ones(1, numel(result))).^(numel(result)-1 :-1:0));

end

end

Explanation:

  • Initialize the variables from 0 as a starting point.
  • Use a while to run it until d is less than userInput variable.
  • Add random 1's and 0's to the array.
  • Return the binary result when it's decimal equivalent is larger than the input number.
You might be interested in
Amber wants to give her audience copies of her presentation so they can follow along and take notes. What option should Amber ch
blagie [28]

Answer:

Print handouts

Explanation:

I had this question and even if you didn't put the answer options i knew what it was I hope this helped you out (:

6 0
3 years ago
Read 2 more answers
True or false FAFSA awards work study, but jobspeaker can be used to learn which jobs are available
Kruka [31]

Answer:

true

Explanation:

random because it's FAFSA and that ain't a word

3 0
2 years ago
How do I translate my Flowchart into Psuedocode?
harkovskaia [24]

Answer:

Step 1

Open the flowchart and locate the startinglocation on the chart.

Step 2

Write the pseudocode that is equivalent to the rectangular process boxes in your diagram.

Step 3

Write the pseudocode for the diamond-shaped decision boxes in your diagram.

Step 4

Write the pseudocode for the end terminator of the flowchart.

Combine all of your converted statements above and you have a flowchart that has been converted to pseudocode.

8 0
3 years ago
1. What does VolP stand for? *
kenny6666 [7]
Answer : c

Explanation:
6 0
3 years ago
Read 2 more answers
What is the output of this program? Assume the user enters 3, 6, and 11.
erica [24]

Answer:

14.0

Explanation:

3 0
1 year ago
Other questions:
  • An existing document that you use as a starting point for a new document; it opens a copy of itself, unnamed, and then you use t
    15·1 answer
  • Which of the following refers to a combination of hardware and software that ensures only authorized individuals gain entry into
    11·1 answer
  • Most software packages have functions for generating _____ about columns of data, which include statistical summaries like contr
    7·1 answer
  • All states that have altered judicial selection techniques in recent years have adopted some form of:
    5·1 answer
  • Why does everyone refer to dogs as being loyal
    11·2 answers
  • Colin is a software developer. He would like to earn a credential that demonstrates to employers that he is well educated on sof
    15·1 answer
  • In what order does the Cascade look at factors to determine which CSS rule to follow?
    14·1 answer
  • A city planner is using simulation software to study crowd flow out of a large arena after an event has ended. The arena is loca
    15·1 answer
  • Look out for users with this photo.
    15·2 answers
  • with a ____ the traffic of a given enterprise or group passes transparently through an internet in a way that effectively segreg
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!