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
andriy [413]
3 years ago
11

Write a MATLAB code which asks a user for an integer number and computes the factorial of that number. Use while loop to create

the code.
Computers and Technology
1 answer:
ivann1987 [24]3 years ago
7 0

Answer:

my_int=input('Enter an integer to calculate its factorial: ');

i=1;%Counter to the while loop

r=1;%To keep the result

while i<=my_int

   r=r*i;

   i=i+1;

end

display('The result is:')

r

Explanation:

The factorial is the multiplication of all positive integers from 1 to n , my_int is the value of n in the program, in a while loop you need a condition that is met until all the positive integers have been multiplied, i is the counter that allows this (starts has one and is increasing by one till it gets the value of n)  and also is useful to make the multiplication and r keeps the result of each step until the condition stop being met and then the program the program leaves the loop and displays the solution.

You might be interested in
How useful is the creation of folders for your computer
aleksandr82 [10.1K]
Depends on your operating system. For any system not Chrome OS, folder creation is an organizational must. Your hard drive stores data sequentially in the form of bits. Whenever you want to access information on your hard drive, the drive has to, much like an array in programming, run through all the data until it comes across the desired file. This, as you could probably imagine, is cumbersome. We, as the users, have the luxury of not having to deal with that kind of information acquisition. We can create folders and directories into which we can place files. The reason I mentioned Chrome OS earlier, was because Chrome OS stores just about everything in the cloud. There isn't any real need to create directories on a Chrome system because all of that data can be managed and stored on Google's servers, as opposed to in files and organized by yourself.
5 0
3 years ago
A(n) ___ is a set of CPUs which work in parallel in an attempt to simulate the way the human brain works, although in greatly si
zhuklara [117]

By definition, a neutral network is a set of CPUs which work in parallel in an attempt to simulate the way the human brain works, although in greatly simplified form.

A neutral network processor is a CPU that takes the modeled operation of how a human brain works on a single chip.

Neutral network processors reduce the requirements for brain-like computational processing of entire computer networks that excel in complex applications such as artificial intelligence, machine learning, or computer vision down to a multi-core chip.

In other words, astificial neutral networks are a computational model that consists of a set of units, called artificial neurons, connected to each other to transmit signals. The input information traverses the neutral network (where it undergoes various operations) producing output values. Its name and structure are inspired by the human brain, mimicking the way biological neurons signal each other.

So the goal of the neutral network is to solve problems in the same way as the human brain, although neural networks are more abstract.

In summary, a neutral network is a set of CPUs which work in parallel in an attempt to simulate the way the human brain works, although in greatly simplified form.

Learn more:

  • brainly.com/question/474553?referrer=searchResults

7 0
3 years ago
I need to create a method named "root positive". which will either print the square root of the number passed to it or if the nu
rjkz [21]

Answer:

Explanation:

The following code is written in Java. It is a method that calculates the square root of a number as requested. The method first checks with an IF statement if the parameter value is a positive number and then calculates the square root and prints it to the screen. Otherwise, it prints Number must not be negative. A test case has been provided in the main method and the output can be seen in the attached image below.

import java.util.Scanner;

class Brainly {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.print("Enter a number of type double to calculate square root:");

       double num = in.nextDouble();

       rootPositive(num);

   }

   public static void rootPositive(double num) {

       if (num > 0) {

           System.out.println(Math.sqrt(num));

       } else {

           System.out.println("Number must not be negative.");

       }

   }

}

5 0
3 years ago
What is the name given to software that decodes information from a digital file so that a media player can display the file? har
KiRa [710]

Answer:

plug-in

Explanation:

A Plug-in is a software that provides additional functionalities to existing programs. The need for them stems from the fact that users might want additional features or functions that were not available in the original program. Digital audio, video, and web browsers use plug-ins to update the already existing programs or to display audio/video through a media file. Plug-ins save the users of the stress of having to wait till a new product with the functionality that they want is produced.

6 0
3 years ago
________ refers to the ability to model components and show how the components' inputs and outputs relate to one another.
Black_prince [1.1K]

Answer:

Central Processing Unit

Explanation:

When the CPU puts the address of a peripheral onto the address bus, the input–output interface decodes the address and identifies the unique computer peripheral with which a data transfer operation is to be executed.

5 0
3 years ago
Other questions:
  • Write a program that reads in text from standard input (hint: use Scanner) and prints out the number of words in the text. For t
    5·1 answer
  • Under which market structure, does a firm have the most influence over product pricing? A. Oligopoly B. Perfect competition C. M
    5·1 answer
  • After clicking the Start button on your computer screen desktop, what option would you then select to examine system components
    10·2 answers
  • How do you know if your phone has a virus?
    13·1 answer
  • An electronic storage file where information is kept is called a cpu. true false
    11·1 answer
  • Which type of account is typically the MOST liquid?
    15·1 answer
  • Mobile apps are replacing the old__________<br><br>​
    7·2 answers
  • Which of the following are the most important reasons people in the 1920s were so interested in seeing lifelike stories in audio
    6·1 answer
  • Read each of the following statements about Computer Science and explain why you think that statement is true.
    9·1 answer
  • TECHNICAL TERMS: the adderess of a website
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!