[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Extrapolation
From: |
Sarah |
Subject: |
Extrapolation |
Date: |
Sun, 18 Aug 2013 11:37:16 -0700 (PDT) |
I want to do interpolation and extrapolation. I can interpolate by using
interp2 command. But, this command didn't perform extrapolation. Is there
any built-in function for extrapolation in octave? I have given an example
in detail.
a= [ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13
14 15 16 17];
b= [ 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001
0.001 0.001 0.001 0.001 0.001 0.011 0.011 0.011 0.011 0.011 0.011 0.011
0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011];
c= [ -0.88 -8.87 -0.86 -0.82 -0.77 -0.71 -0.66 -0.62 -0.57 -0.54 -0.50 -0.47
-0.44 -0.42 -0.39 -0.377 -0.36 -0.89 -0.88 -0.85 -0.81 -0.76 -0.71 -0.66
-0.61 -0.57 -0.53 -0.50 -0.47 -0.44 -0.42 -0.39 -0.37 -0.36];
cc = repmat(c,34,1);
ci= interp2(a, b, cc, 1.5, 0.0015) % Interpolation at some point
ai= [ 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5 8 8.5 9 9.5 10 10.5 11 11.5
12 12.5 13 13.5 14 14.5 15 15.5 16 16.5 17 17.5 1 1.5 2 2.5 3 3.5 4 4.5 5
5.5 6 6.5 7 7.5 8 8.5 9 9.5 10 10.5 11 11.5 12 12.5 13 13.5 14 14.5 15 15.5
16 16.5 17 17.5];
bi= [ 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001 0.001
0.001 0.001 0.001 0.001 0.001 0.001 0.0015 0.0015 0.0015 0.0015 0.0015
0.0015 0.0015 0.0015 0.0015 0.0015 0.0015 0.0015 0.0015 0.0015 0.0015 0.0015
0.0015 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017
0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.0017 0.011 0.011 0.011 0.011
0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011 0.011
0.011];
cim= interp2(a, b, cc, ai, bi) % Interpolation matrix
ce= interp2(a, b, cc, 18, 0.2) % Extrapolation at some point
ae= 4* [ 1 1.5 2 2.5 3 3.5 4 4.5 5 5.5 6 6.5 7 7.5 8 8.5 9 9.5 10 10.5 11
11.5 12 12.5 13 13.5 14 14.5 15 15.5 16 16.5 17 17.5 1 1.5 2 2.5 3 3.5 4 4.5
5 5.5 6 6.5 7 7.5 8 8.5 9 9.5 10 10.5 11 11.5 12 12.5 13 13.5 14 14.5 15
15.5 16 16.5 17 17.5];
be= [ 0.101 0.101 0.101 0.101 0.101 0.101 0.101 0.101 0.101 0.101 0.101
0.101 0.101 0.101 0.101 0.101 0.101 0.1015 0.1015 0.1015 0.1015 0.1015
0.1015 0.1015 0.1015 0.1015 0.1015 0.1015 0.1015 0.1015 0.1015 0.1015 0.1015
0.1015 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017
0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.1017 0.111 0.111 0.111 0.111
0.111 0.111 0.111 0.111 0.111 0.111 0.111 0.111 0.111 0.111 0.111 0.111
0.111];
cem= interp2(a, b, cc, ae, be) % Extrapolation matrix
How can I find 'ce' and 'cem' in this case? Here, it gives "NA". How should
I extrapolate to find 'ce' and 'cem' ?
Thanks in advance
Sarah
--
View this message in context:
http://octave.1599824.n4.nabble.com/Extrapolation-tp4656696.html
Sent from the Octave - General mailing list archive at Nabble.com.