Plot fitted polynomial and all data points

Assignment Help MATLAB Programming
Reference no: EM131026508

Problem:

A noise that grows louder over time is measured six times, and the following dataset is created (data in NoiseTime.txt and NoiseLoud.txt): 

Time (s)

1

1.3

...

5.6

6

Loudness (dB)

1.3

2.7

...

86

104

 Use MATLAB to perform the following tasks:

(Note: You will have to run this program more than once in order to complete it.)

a) Determine which type of function may provide the best fit by plotting the data on the following axes. Use the subplot command to include them in the same window (see problem c for plot arrangement).

X -axis

Y - axis

Function

Linear

Linear

Linear  y=mx+b

Logarithmic

Logarithmic

Power Y=bxm

Linear

Logarithmic

Exponential  y= bemx

 The best function is the one whose data points appear to be in a straight line. Decide upon the best function, and output your choice of function to the command window (linear, logarithmic, or exponential).

b) Use polyfit to find a polynomial that fits the data. Use the following table to choose the correct format for polyfit. Note: polynomial degree n=1 always when fitting a non-polynomial. The first element p(1) gives m, and the second element p(2) gives b. In order to plot on linear-linear axes, you will have to transform the constants back. Output the values of m and b, transformed to linear-linear axes (to 3 decimal places), to the command window (using fprintf).

Function

Polytfit form

Linear

P=polytfit(x,y,n)

Power

P=polyfit(log(x),log(y),1)

Exponential

P=polyfit(x,log(y),1)

c) Plot your fitted polynomial and all data points (using linear-linear axes) as a fourth subplot in the same window (as shown below). Use intervals of 0.1. Include a legend.

Subplot arrangement

Linear Data Plot  (1,1)

Power Transformed Data Plot (2, 1)

Exponential Transformed Data Plot (2, 1)

Fitted Function Plot (2, 2)

Additional information

This question to MATLAB software and discusses about application of MATLAB in mathematics to solve polynomials and to perform given tasks.  

Answer is in MATLAB format

Reference no: EM131026508

Questions Cloud

Calculate the energy of a photon : Photon fundamentals. Show that hc = 1240 eY·nm. Calculate the energy of a photon with each of the following wavelengths: 650 nm (red light); 450 nm (blue light); 0.1 nm (x-ray); 1 mm (typical for the cosmic background radiation).
What is the impact of the french influential elite : What is the impact of the French influential elite whose roots lie in the bureaucracy? Discuss what France's recent foreign policy says about its character as a nation.
What direction do you feel nigeria should take in the future : "How have the frequent shifts from civilian to military rule and back again exacerbated Nigeria's social and economic problems? What direction do you feel Nigeria should take in the future? Explain."
How the gaussian approximation becomes more accurate : Use a computer to plot the function xne-x, and the Gaussian approximation to this function, for n = 10, 20, and 50. Notice how the relative width of the peak (compared to n) decreases as n increases, and how the Gaussian approximation becomes mor..
Plot fitted polynomial and all data points : Plot fitted polynomial and all data points (using linear-linear axes) as a fourth subplot in the same window (as shown below). Use intervals of 0.1.
What are the main strengths of this method : Does the use of linear algebra make this method easier to understand or use?
Show that electric field at the center of triangle is zero : Three identical point charges each of chargeq are located at the vertices of an equilateral triangle as in the figure shown below. The distance from the center of the triangle to each vertex isa. Show that the electric field at the center of the t..
Method-of-moments estimator : Find the method-of-moments estimator of p based on this single observation Y.
How do you make decisions : How Do You Make Decisions? In this course, you will read about theories regarding how people make decisions and how they should make decisions.

Reviews

Write a Review

MATLAB Programming Questions & Answers

  Use regression algorithms

The proposal which are two pages and here is the demands - Use Regression Algorithms or any type to achieve the target In Data Mining matter dealing with E-Learning Students' Data.

  Overlap-add and overlap-save methods

Write two matlab functions to convolve two sequences using both the overlap-add and overlap-save methods

  Implement runge-kutta integration scheme

Implement Runge-Kutta integration scheme with Δ = 0:005 for system (2),(3).Plot the phase curves (trajectories x(t); y(t) in the phase/state space).

  How do you create a new script or function in matlab

What is the difference between a script and function. How do you create a new script or function in MATLAB

  The function should compute and return

Define a function that takes as input parameters a function handle f, start and end values a and b, and a number of steps n. The function should compute and return the x and y values of the maximum of the function over the range a to b.

  Finds the value of a using a numerical method

Finds the value of a using a numerical method

  Secant method to tryt to find out the root

create a function that will use the secant method to tryt to find out the root

  Describe how you would access these 4 members

Create a namespace titled global Type that contains four members. The members should be two named constants, n and rate. It should also contain a variable count and the function printResult. Describe how you would access these 4 members in a progr..

  Find the acceleration by taking the derivative again

We can find the acceleration by taking the derivative again.

  Compute and plot 4 mean temperature profiles

Generate by measdata.m an array A withsize (365,24), containing temperature measurements for an entire year [1 January,..., 31 December], 24 hours a day [00.00h,...,23.00h].

  Compute the power spectral density vector

Compute the power spectral density vector. Plot the spectrogram using the same parameters as in lecture.

  Use the sandp 500 excess returns and inflation

Use the S&P 500 excess returns and inflation to predict Intel stock excess returns. Provide the regression equation for the Intel stock excess returns when using S&P 500 excess returns and inflation as explanatory variables.

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