CS 131 MP 1

Instructions: Follow each of the instructions. Failing to follow atleast one might lead to non-acceptance of MP.
 1) Use Octave. Store functions in separate files. Create a script fi le that will run all the necessary code
and name the file: main.m. At the top most row of the fi le put a comment containing your name,
student number and section.
2)  Zip all deliverables in one folder named: surname_firstname:zip. Deliverables compressed using other formats won’t be checked.
 3) Deadline of this MP will be on Feb 19, 2016, 11:30 PM. Submit via UVLE.

The goal of this Machine Problem is to implement Linear Splines, Quadratic Splines and Cubic Splines
over a set of Cartesian points. Given a text fi le named: input.txt, containing a sequence of coordinate points.
Create a program that will connect the dots using linear splines, quadratic splines and cubic splines. Plot
the results in separate graphs.

Points will be ordered as they appear in the text fi le. If the term SHAPE appears, then it means that
a next point should not be connected from the previous point. Each point will be represented using the
following format x,y i.e. 1,􀀀5 represents the point with an x value of 1 and y value of 5.

The following is a sample input file

Cubic splines will no longer be discussed in class, but please read the following material for your guidance.  Assume that you will be using Natural Splines.

 

Clarification:

In the event of having 2 consecutive points with the same x values, you will have to generate the set of splines separately. ie

(1,1), (3,2), (4,1), (6,1), (6,2),(8,1),(2,4)

We can see that (6,1) and (6,2) has the same x values. In that case, compute for the splines for (1,1),(3,2), (4,1) and (6,1) and compute  the splines for (6,2), (8,1) and (2,4) separately, then connect (6,1) and (6,2) with a vertical line.

 

1 thought on “CS 131 MP 1

  • In that case, compute for the splines for (1,1),(3,2), (4,1) and (6,1) and compute  the splines for (6,2), (8,1) and (2,4) separately, then connect (6,1) and (6,2) with a vertical line. Where is this information?

Comments are closed.