Write an m-file to calculate the factorial function of n

Assignment Help Civil Engineering
Reference no: EM13317846

Write an M-file to calculate the factorial function of N!, as defined by: N!=1 N=0 N!=N*(N-1)*(N-2)*...*3*2*1 N>0 The MATLAB code to calculate N factorial for positive value of N would be n_factorial=1 for 11=1:n n_factorial=n_factorial*ii; end Be sure to handle the special case of 0! Alos, be sure to report and error if N is negative or not and integer

Reference no: EM13317846

Questions Cloud

What is the smallest diameter particle of specific gravity : What is the terminal settling velocity of a particle with a specific gravity of 1.4 and a diameter of 0.01 mm in 20 degrees celcius water. What is the smallest diameter particle of specific gravity 1.4
Determine time to reach maximum height : A projectile is fired with an initial speed of 113 m/s at an angle of 60 degrees above the horizontal, from the top of a cliff which is 49.0 meters high. determine time to reach maximum height
Calculate the total head the pump is pumping against : A pump has the following pump curve is pumping at a rate of 5000gpm. Calculate (a) the total head the pump is pumping against. (b) brake horsepower required to drive the pump.
What is the weight of the truck : A small ferryboat is 4.00 m wide and 6.00 m long. When a loaded truck pulls onto it, the boat sinks an additional 4.60 cm into the river
Write an m-file to calculate the factorial function of n : Write an M-file to calculate the factorial function of N!, as defined by: N!=1 N=0 N!=N*(N-1)*(N-2)*...*3*2*1 N>0 The MATLAB code to calculate N factorial for positive value of N would be n_factorial=1
Find its youngs modulus : For safety in climbing, a mountaineer uses a nylon rope that is 60 m long and 1.0 cm in diameter. Find its Young's modulus
Which object has the greater final speed : Starting from rest, object 1 is subject to a 10Nforce for 2.0 s. Object 2, with twice the mass, is subject to a 15N force for 3.0 s
How does this event affect the demand for money : If the fed does not respond to this event what will happen to the price level?
Determine the rate of return that the company will make : Five years ago, GSI, an oil services company headquartered in Texas, issued $10 million worth of 12% 30-year bond with the dividend payable quarterly. The bonds have a call date of this year if GSI decides to take advantage of it.

Reviews

Write a Review

Civil Engineering Questions & Answers

  Determine what is the maximum queue length

Vehicles arrive at the booth at a rate of 4 vehicles per minute. The attendent opens the booth and improves the service rate over time following the function u(t)= 1.1 +0.3t, where u(t) is in vehicles per minute and t is in minutes.

  Determine what percent of particle are retained in clarifier

if the settling velocity of a particle is 2.8 mm/s and the overflow rate of an upflow clarifier is .56 cm/s what percent of the particles are retained in the clarifier

  What would be the reading on a barometer containing benzene

What would be the reading on a barometer containing Benzene at 20 degrees Celsius at a time when the atmospheric pressure was equivalent to 12.3 m of water

  Find the force exerted by the jet on the vane

A pipeline terminates in a nozzle of outlet diameter = 0.15 m. The free jet from the nozzle is deflected through 120º by a vane as shown. Water flow rate through this pipe is 0.25 m3/s. Ignoring friction, find the force exerted by the jet on ..

  Related geotechnical engineering

This material is related Geotechnical Engineering, please only answer if you are certain and sure of your answer. An undisturbed soil sample has a dry unit weight of 112 pcf with a specific gravity of solids equals to 2.68.

  What is the stress in the lowermost rock

The Washington Monument is 169 m tall. What is the stress in the lowermost rock if it is made of Georgia granite?

  Determine the maximum moment that can be carried

A rectangular reinforced concrete beam with dimensions b = 14in, d = 25in, and h = 28in is reinforced with three No. 10 bars. Material strengths are fy = 60,000 psi and fc prime = 5,0000 psi.

  Compare and contrast the purpose and scope

Compare and contrast the purpose and scope of the Federal Insecticide, Fungicide, and Rodenticide Act with the provisions of the Federal Food, Drug, and Cosmetic Act.

  Draw elevation, plan and development of the lateral surfaces

Axis of the hole is perpendicular to VP. Draw elevation, plan and development of the lateral surfaces of the pyramid.

  Calculate the ph when acetic acid is a weak acid

acetic acid is a weak acid. Its Ka is 1.8(10^-5). For a concentration of 0.015 M, calculate the pH.

  Determine how long do one have to escape

You are in an old spy movie, and have been locked into a small room (volume 1000 ft). You suddenly realize that a poison gas has just started entering the room through a ventilation duct.

  Calculate equivalent pipe size and flow in the pipe

The first pipe of 0.4-m diameter is 500 m long, the second pipe 600 m long, size 0.3 m, and the last pipe is 500 m long of diameter 0.2 m. If the elevation difference between two reservoirs is 30 m, calculate equivalent pipe size and flow in the p..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd