User-defined function, MATLAB Programming

Assignment Help:

Your functions will allow you to create the following 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. Notice that where each interval meets, points with an ‘o' marker are located. Each one of the 4 functions you create will plot something on a single figure.

Create a function called cs151f11assn5first. The purpose of this function is to plot the line of the first interval. This function has four input arguments (in this order): 

the x and y coordinates of a point on the line (matrix of two values: x and y)

the x and y coordinates of a point the line (matrix of two values: x and y)

a scalar of the beginning of the interval of the x-domain on the figure

a scalar of the end of the interval of the x-domain on the figure

This function does not return any values, meaning it has no output arguments.  This function will first calculate the slope of the line using the two points. To do this, calculate the change in y divided by the change in x, aka the rise over run equation.  You will also need to find the y-intercept. To do this, use the x and y values of one of the points and solve for b in the equation b mx y (remember, m is the slope you just calculated).  A vector of x-values will need to be created using the beginning and ending values of interval of the x-domain, with an increment of 0.1.  Then, create the y-values using the equation mx + b Finally, plot the line in red.

924_user-defined function.png


Related Discussions:- User-defined function

Model of a column loudspeaker system, Use an expression for the far-field r...

Use an expression for the far-field radiation from a plane circular piston to create a more accurate model of a column loudspeaker system - you will need to calculate individual so

Implement code to determine the frequency components, Objectives In the ...

Objectives In the following exercises, students are required ?rstly to implement code to determine the frequency components present in a signal, and then to extract a desired si

Plot the pressure for oxygen and nitrogen, Non-Ideal Gas (van der Waals equ...

Non-Ideal Gas (van der Waals equation):  An equation of state for a non-ideal which is commonly used is the van der Waals equation for 1 mol of gas  P = (R*T)/(V-b) - a/(V^2)

Find the distribution of data with matlab, how to make a histogram of data,...

how to make a histogram of data, example x=[5 6 3 2 5] and then find the distribution

CAlculus, kind in geometric calculity in space AREA. >

kind in geometric calculity in space AREA. >

IMAGE PROCESSING, IMAGE PROCESSING TECHNIQUES TO FIND THE HUMAN BLOOD GROUP...

IMAGE PROCESSING TECHNIQUES TO FIND THE HUMAN BLOOD GROUP

Speech recognition using support vector machine, what are data collect th...

what are data collect this topic,how i can create algorithm in mat lab what language support easy to this topic

Help me..., construct a matlab program to calculate and to plot the electro...

construct a matlab program to calculate and to plot the electron and hole concentration as a function of the Fermi-level in an energy gab of Si at a Given temperature and the carri

Splitting a column into separate arrays, I have a file to be read in matlab...

I have a file to be read in matlab which carries different columns in it. Each column has around 200000 readings in set of 2000. I want a code in a loop which gives stores each col

Compute the moments, Show (turn in) similar output images as in part 2 for ...

Show (turn in) similar output images as in part 2 for each of your new images (there is only 1 connected component in this case). Write three functions which compute the moments, c

Write Your Message!

Captcha
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