The new forums will be named Coin Return (based on the most recent vote)! You can check on the status and timeline of the transition to the new forums here.
The Guiding Principles and New Rules document is now in effect.

Octave/Matlab Math Thing Help

b0bd0db0bd0d Registered User regular
edited October 2009 in Help / Advice Forum
Okay, I got some homework for a class and I just don't understand what I am supposed to do. Check it out:
Here is one way of interpolating data points (xi,yi) when they do not resemble a single-valued function: treat xi and yi as two distinct functions in the index i and interpolate each with respect to i. <get data from website> Use interp1 along with the 'not-a-knot' condition to create Figure 1. You may choose a step size .05 for the plot. Finally, perform a random, but simultaneous, permutation on both xi and yi. how does this affect the result of the interpolation? What does this imply in term of the order of the data points?

Website data:
# name: x
# type: matrix
# rows: 27
# columns: 1
0.8122405581550802
0.7659705046791443
0.8136864973262031
0.7732002005347594
0.7211463903743316
0.825254010695187
0.870078125
0.8122405581550802
0.7659705046791443
0.6777682152406417
0.5664308990641711
0.5678768382352941
0.609809074197861
0.57076871657754
0.5042555147058823
0.4203910427807486
0.329296875
0.3408643883689839
0.3683372326203208
0.3379725100267379
0.3524319017379678
0.3625534759358288
0.3466481450534759
0.3726750501336898
0.4203910427807486
0.4478638870320855
0.4290666778074866
# name: y
# type: matrix
# rows: 27
# columns: 1
0.2801369863013699
0.302054794520548
0.3705479452054794
0.5226027397260273
0.5815068493150685
0.5952054794520547
0.6239726027397261
0.6582191780821918
0.6993150684931506
0.7691780821917809
0.7321917808219178
0.613013698630137
0.5226027397260273
0.5253424657534247
0.5116438356164383
0.4746575342465753
0.4924657534246575
0.4582191780821918
0.4267123287671233
0.428082191780822
0.397945205479452
0.3732876712328768
0.3664383561643836
0.3116438356164384
0.2691780821917809
0.2472602739726028
0.2349315068493151

Okay, if I just plot(x,y) I get a duckling image. I don't understand how I'm supposed to interpolate shit. What exactly is the question asking? I've been setting up some points like this:
xx = 0:.05:1.30;
then
interp1( x, xx,xx)
That gives me gibberish.

b0bd0d on

Posts

  • ProPatriaMoriProPatriaMori Registered User regular
    edited October 2009
    I don't know exactly how to make MATLAB do the following, but it sounds like you're supposed to treat both the x and y data as parameterized by a third variable in order to interpolate values at other x and y values.

    ProPatriaMori on
  • OrestesOrestes Registered User regular
    edited October 2009
    I don't think interp1 is a built in Matlab function...

    I stand correct, a quick google tells meee.....

    MATLAB INTERP1

    I have no idea how the hell that works (I've always prefered writing my own interpolation's rather then Matlab doing my shit for me).

    Orestes on
Sign In or Register to comment.