Question: How to solve Part 1 : A Function ( 1 0 pts ) Write a function that computes the area under the curve using the

How to solve
Part 1: A Function(10 pts)
Write a function that computes the area under the
curve using the trapezoidal rule, but using every-
other data point.
Function name: calc_trap_odd
Inputs: two: x and y data vectors
Outputs: one: the value of the integral
So the first line take Matlab's default: function
[outputArg1,outputArg2]=
untitled(inputArg1,inputArg2) and change it to
function [l_calc]= calc_trap_odd (x,y)
This should calculate the integral based on the
concept in this graph:
When you use this function, it might look like this:
>x=[0:.5:];
>y=sin(x);
>I=calctrapodd(x,y)
I=
1.8213
Part 2: Integrating (10 pts)
A. Find the integral of I=23(x+sin(x))dx in steps
of 0.1.
Solve using trapz (built-in MATLAB function)
Solve using calc_trap_odd
Solve using Simpson's 13 Rule
Discuss the differences in the results from the three
calculations.
Formal Plotting program
Write a function that creates an engineering plot of the input data. Sample plot
Function name: ME_plot
Inputs: three: xdata and ydata - vectors of points, a fittedmodel from the Curve Fit App.
Outputs: a complete graph
Data plotted as points
A best fit curve
A title box: title, name, class/section or data of collection, best fit equation
if the user selects it, the value of the area under the data
Comments
H1 help line
Author and creation date information
Explanations of code and variables as necessary
Function should allow the user to define the text for the various labels. (use the MatLab command input or inputdlg)
Function should be easy to use!! The concept is to walk the user through all the steps they need to get the info added to the graph. You can
Practical analysis. Download this dataset +-. This data represents a stress-strain curve of 6061-T6 Aluminum.
You need to determine:
a) plot the data in a proper ME graph, including labels and a curve fit for at least part of the data
b) the Modulus of Elasticity and
c) the Modulus of Toughness
from the experimental data. If you do not recognize these terms, a quick web search (perhaps from wiki or
instron.us - maker of test equip) should help.
Notes:
Different data sets have different plot symbols
Different lines use different line types
Each data set has its own curve fit - a best fit line that approximates the data
Axes and data are labeled
Title, author, collection info and equations for best fit line are in a title box
Control fonts, colors, legends, grids, etc.
Formal Plotting program
Write a function that creates an engineering plot of the input data. Sample plot darr
Function name: ME_plot
Inputs: three: xdata and ydata - vectors of points, a fittedmodel from the Curve Fit App.
Outputs: a complete graph
Data plotted as points
A best fit curve
A title box: title, name, class/section or data of collection, best fit equation
if the user selects it, the value of the area under the data
Comments
H 1 help line
Author and creation date information
Explanations of code and variables as necessary
Function should allow the user to define the text for the various labels. (use the MatLab command input or inputdlg)
Function should be easy to use!! The concept is to walk the user through all the steps they need to get the info added to the graph. You can
Practical analysis. Download this dataset +-. This data represents a stress-strain curve of 6061-T6 Aluminum.
You need to determine:
a) plot the data in a proper ME graph, including labels and a curve fit for at least part of the data
b) the Modulus of Elasticity and
c) the Modulus of Toughness
from the experimental data. If you do not recognize these terms, a quick web search (perhaps from wiki or
instron.us - maker of test equip) should help.
How to solve Part 1 : A Function ( 1 0 pts )

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!