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
iren [92.7K]
3 years ago
9

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

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

Answer:

function [outArray] = potd11(inputNumber)

outArray = [0];

d = 0;

while d < inputNumber

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

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

end

end

Explanation:

You might be interested in
A _______ is the most commonly used input device.
nirvana33 [79]
The answer is B.Keyboard
4 0
3 years ago
Read 2 more answers
What do you need to know?
steposvetlana [31]
Uhhh thanks for asking... but I think I know everything. Lol jk
3 0
3 years ago
Read 2 more answers
Which element of color theory helps designers choose color schemes that create an appealing visual?
WITCHER [35]

Answer of this question is

C. Design

4 0
3 years ago
Read 2 more answers
g Write a C program that prompts the user for a string of, up to 50, characters and numbers. It can accept white spaces and tabs
Pavel [41]

Answer:

Following are the code to this question:

#include <stdio.h> //defining header file

#include <string.h>//defining header file

int main()//defining main method

{

char name[50]; //defining character variable

int A=0,E=0,I=0,O=0,U=0,value=0,i,l; //defining integer variables

printf("Enter string value: ");//print message

gets(name);//input value by gets method

l=strlen(name);//defining l variable to store string length

for(i=0; i<50; i++) //defining loop to count vowels value

{

if(name[i] == 'A' || name[i] == 'a') //defining if condition count A value A++;//increment value by 1

else if(name[i] == 'E' || name[i] == 'e')//defining else if condition count E value

E++;//increment value by 1

else if(name[i] == 'I' || name[i] == 'i') //defining else if condition count I value

I++;//increment value by 1

else if(name[i] == 'O' || name[i]== 'o') //defining else if condition count O value

O++;//increment value by 1

else if(name[i] == 'U' || name[i] == 'u')//defining else if condition count U value

U++;//increment value by 1

else if(name[i]>= '0' && name[i] <= '9')//defining else if condition count digits value

value++;//increment value by 1 }

printf("A: %d\n",A);//print A value

printf("E: %d\n",E); //print E value

printf("I: %d\n",I);//print I value

printf("O: %d\n",O);//print O value

printf("U: %d\n",U);//print U value

printf("value: %d",value);//print digits value

return 0;

}

Output:

please find the attachment.

Explanation:

  • In the above code, a char array "name" and integer variables "A, E, I, O, U, i, value and l" declared, in which name array store 50 character value, which uses the gets function to take string value.after input value strlen method is used to store the length of the input string in l variable.
  • In the next step, for loop is declared that uses multiple conditional statements to counts vowels and the values of the digits,if it is more then one it increments its value and at the last print method is used to print its count's value.

7 0
3 years ago
Will any data be lost when i enable icloud drive on my sierra imac and ios devices
AleksAgata [21]
No actually because there is something called gigabyte searching and really all it is is that they can still find your files through looking at all the Prossecesd memory in your computer, phone,....... and so there is always a way to get your data back
8 0
4 years ago
Other questions:
  • Write a copy assignment operator for CarCounter that assigns objToCopy.carCount to the new objects's carCount, then returns *thi
    15·1 answer
  • Linda has written a program that works well on various operating systems, but she needs to increase the readability of the progr
    14·1 answer
  • Write the definitions of two classes Day and Night. Both classes have no constructors, methods or instance variables. Note: For
    8·1 answer
  • A user calls you and says that when they try to connect to the internal website, they are prompted for authentication. The user
    14·1 answer
  • What are the examples of debugging?​
    14·1 answer
  • This finding maximum number function will keep on going until we reach at the last value
    12·1 answer
  • Nadia has inserted an image into a Word document and now would like to resize the image to fit the document befter. What is the
    11·1 answer
  • Can someone compress this ipv6 address? 558c:0000:0000:d367:7c8e:1216:0000:66be
    9·1 answer
  • See attached. I have code typed out but still having problems.
    10·1 answer
  • Hello guys where's bios chip in this motherboard ​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!