Write a user-defined matlab function for given math function

Assignment Help MATLAB Programming
Reference no: EM131954035

Question 1 - Answer problems 1, 2, 3 and 4 -

1. Write a user-defined MATLAB function for the following math function: y(x) = 0.6x3e-0.47x + 1.5x2e-0.6x

The input to the function is x and the output is y. Write the function such that x can be a vector (use element-by-element operations).

(a) Use the function to calculate y(-2) and y(4).

(b) Use the function to make a plot of the function y(x) for -4 ≤ x ≤ 8.

2. Write a user-defined MATLAB function for the following math function: r(θ) = 3 sin(3cos(0.5θ))

The input to the function is θ (in radians) and the output is r. Write the function such that θ can be a vector.

(a) Use the function to calculate r(π/6) and r(5π/6).

(b) Use the function to plot (polar plot) r(θ) for 0 ≤ 0 ≤ 4π.

3. In the U.S. fuel efficiency of cars is specified in miles per gallon (mpg). In Europe it is often expressed in liters per 100 km. Write a MATLAB user-defined function that converts fuel efficiency from mpg to liters per 100 km. For the function name and arguments, use Lkm = mpgToLpkm (mpg). The input argument mpg is the efficiency in mi/gl, and the output argument Lkm is the efficiency in liters per 100 km (rounded to the nearest hundredth). Use the function in the Command Window to:

(a) Determine the fuel efficiency in liters per 100 km of a car whose fuel efficiency is 21 mi/gal.

(b) Determine the fuel efficiency in liters per 100 km of a car whose fuel efficiency is 36 mi/gal.

4. Pressure in U.S. customary units is measured in psi (pound per square inch).

In SI metric units pressure is measured in Pa (N/m2). Write a user-defined MATLAB function that converts pressure given in units of psi to pressure in units of Pa. For the function name and arguments, use [Pa] = Psi - ToPa (psi). The input argument psi is the pressure in units of psi to be converted, and the output argument Pa is the converted pressure in units of Pa (rounded to the nearest integer). Use the function in the Command Window to:

(a) Convert 120 psi to units of Pa.

(b) Convert 3,000 psi to units of Pa.

Question 2 - Solve the following second-order differential equation - x·· +2ζωnx· + ωn2x = Asin(ωt)

Where x· = dx/dt, x·· = d2x/dt2, ζ = 0.5, ωn = 40 rad/s, A = 80, ω = 50. Use the function ode45() with 0 ≤ t ≤ 10s. Plot x and x· versus time on the same page and use the appropriate labels.

Question 3 - Compute the following indefinite integral

I(x) = ∫((x(x+1))½/√x+√(1+x)) dx

Reference no: EM131954035

Questions Cloud

Price and equilibrium quantity of caviar : Explain the effects on the market for caviar. What do you expect will happen to the price and equilibrium quantity of caviar?
Explain any ethical dilemmas that could arise : Explain any ethical dilemmas that could arise during your advocacy campaign, and how you would resolve them.
Cover the cost of your child college education : What annual rate of interest must you earn on your investment to cover the cost of your child’s college education?
Goal of maximized profitability : Construct a tutorial that shows users of it how to apply marginal cost and marginal revenue concepts to business operations with the goal of maximized profitabi
Write a user-defined matlab function for given math function : Write a user-defined MATLAB function for the following math function: The input to the function is x and the output is y
Executive summary for article- managers with a cross-culture : Which are the three most CRITICAL ISSUES for this reading? Please explain why? and analyze, and discuss in great detail.
Medical care and hospitalization : If the producers of the good (medical care and hospitalization) were to decide to raise prices, how would their total revenue be affected?
Calculate present value of the annuity : calculate the present value of the annuity.
Determine whether the law and the anas standards support : Consider what action you would take if you were Lena and why. Determine whether the law and the ANA's standards support or conflict with that action.

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Finite difference method

Use the finite difference method to calculate the temperature at the point specified since it is easier.

  Determine the necessary shell temperature

In a shell-and-tube heat exchanger, one fluid passes through a central tube while another fluid flows through an outer shell in the opposite direction. The purpose is to heat the fluid passing through the central tube.

  Find the integral of a function at an arbitrary location

Write a Matlab function to perform numerical integration of a set of evenly spaced data points using the trapezoidal rule

  Compute the speed of single-stage planetary gear train

Write a MATLAB function [speed] = planetary (N, emesh, first, last, arm) that computes the speed of a given link in a single-stage planetary gear train.

  Calculate and plot the error in the numerical derivative

Write a program to calculate and plot the error in the numerical estimate of the derivative.

  Create the graph using matlab functions

Create the graph, which contains a piecewise function where a line exists in the first interval, a parabola in the second interval, and the sine function in the third interval.

  Develop a simulation program

Develop a simulation program

  Create a vector in matlab

Create a three dimensional diagram of function.

  Open a named pipe and to read data from the pipe

Open a named pipe and to read data from the pipe in matlab

  Write the commands that will create the matrix

Write the commands that will create the matrix.

  Lagrange interpolating polynomial of degree

Lagrange interpolating polynomial of degree

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