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
How is the internet made?
sergey [27]

The Internet was made for shopping, searching. It was first made when the computers came out. (Windows Vista) Now you can watch videos or play games. The internet was main browsing and shopping. The internet today is really advanced and has made it was to phones and TVs. The internet wasn't the first thing you can do on the computer, you could write up a paper or do a slide show.

The Internet was created by Bob Khan and Vint Cerf. The Internet is like a big Tree. The websites are the bushes and the branches are the makers of the website. The internet today just a bunch of makers who make websites that you can access through the internet. If there were no websites there would be no internet. So if the internet quits (The Internet cant) Google and other big websites will be shut down. So the internet is a home for all the websites we use today.

This is really long but I tried not to make it so complicated and sound like I didn't copy and paste. I really hope this helped you in someway and Your Welcome. :)

8 0
2 years ago
Write any two use of computer in school​
igomit [66]

Answer:

To solve mathmatical problem

To make questions paper

7 0
3 years ago
Which of the following describes a BYOD?
Law Incorporation [45]

Answer:

A policy allowing or encouraging employees, contractors, and others to connect their own computers, smartphones, and other devices to their organization's networks.

Explanation:

BYOD - Bring Your Own Device

6 0
3 years ago
Do network packets take the shortest route?
Sergio039 [100]

Answer:

The packet will take a shorter path through networks 2 and 4

5 0
2 years ago
Read 2 more answers
_____ is a predefined format used for text the can include multiple font formatting features
seraphim [82]
The correct answer is



style
8 0
3 years ago
Other questions:
  • Integrated circuits are made up of _____ that carry the electrical current.
    14·1 answer
  • How do you open Microsoft Excel 2013 with Windows 8?
    13·1 answer
  • Write a program that loops one thousand times. add all the even numbers and display the results. add all the odd numbers and dis
    13·1 answer
  • Which is the correct process for adding page numbers to a spreadsheet you will print? A. Click Page Break Preview. Type the page
    7·1 answer
  • George and Miguel want to know more about their local and online competitors and about the retail industry. What is the best way
    9·1 answer
  • According to Holpp and Kelly's approaches to developing vision, the benchmarking approach is more internally focused, whereas th
    6·1 answer
  • What is an identifier? Give an example of an identifier.
    13·1 answer
  • The __________ assumption necessary for a linear programming model to be appropriate means that the contribution to the objectiv
    6·1 answer
  • I need help, whoever gets it correct will get brainliest
    7·1 answer
  • An F-1 ____________ may be authorized by the DSO to participate in a curricular practical training program that is an__________
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!