Open in the MATLAB editor: e01tm_example
function e01tm_example fprintf('e01tm example results\n\n'); x = [0.81, 0.91, 0.13, 0.91, 0.63, 0.10, 0.28, 0.55, 0.96, 0.96, 0.16, ... 0.97, 0.96, 0.49, 0.80, 0.14, 0.42, 0.92, 0.79, 0.96, 0.66, 0.04, ... 0.85, 0.93, 0.68, 0.76, 0.74, 0.39, 0.66, 0.17; 0.15, 0.96, 0.88, 0.49, 0.41, 0.13, 0.93, 0.01, 0.19, 0.32, 0.05, ... 0.14, 0.73, 0.48, 0.34, 0.24, 0.45, 0.19, 0.32, 0.26, 0.83, 0.70, ... 0.33, 0.58, 0.29, 0.26, 0.26, 0.68, 0.52, 0.08; 0.44, 0.00, 0.22, 0.39, 0.72, 0.77, 0.24, 0.04, 0.95, 0.53, 0.16, ... 0.36, 0.28, 0.58, 0.64, 0.12, 0.03, 0.48, 0.15, 0.93, 0.41, 0.40, ... 0.15, 0.88, 0.88, 0.09, 0.33, 0.69, 0.17, 0.35; 0.83, 0.09, 0.21, 0.79, 0.68, 0.47, 0.90, 0.41, 0.66, 0.96, 0.30, ... 0.72, 0.75, 0.19, 0.57, 0.06, 0.68, 0.67, 0.13, 0.89, 0.17, 0.54, ... 0.03, 0.81, 0.60, 0.41, 0.64, 0.37, 1.00, 0.71; 0.21, 0.98, 0.73, 0.47, 0.65, 0.22, 0.96, 0.26, 0.99, 0.84, 0.58, ... 0.78, 0.28, 0.25, 0.08, 0.63, 0.66, 0.28, 0.40, 0.61, 0.09, 0.37, ... 0.36, 0.40, 0.47, 0.14, 0.36, 0.12, 0.43, 0.17]; f = [6.39; 2.50; 9.34; 7.52; 6.91; 4.68; 45.40; 5.48; 2.75; 7.43; 6.05; 5.77; 8.68; 2.38; 3.70; 1.34; 15.18; 4.35; 1.50; 3.43; 3.10; 14.33; 0.35; 4.30; 3.77; 4.16; 6.75; 5.22; 16.23; 10.62]; xe = [0.1, 0.2, 0.3, 0.4, 0.5, 0.6; 0.1, 0.2, 0.3, 0.4, 0.5, 0.6; 0.1, 0.2, 0.3, 0.4, 0.5, 0.6; 0.1, 0.2, 0.3, 0.4, 0.5, 0.6; 0.1, 0.2, 0.3, 0.4, 0.5, 0.6]; % Generate the interpolant nq = int64(0); nw = int64(0); [iq, rq, ifail] = e01tm(x, f, nw, nq); % Evaluate the interpolant [q, qx, ifail] = e01tn(x, f, iq, rq, xe); fprintf('\n | Interpolated Evaluation Points | Values\n'); fprintf('---|---------------------------------------------------+--------\n'); fprintf(' i | xe(i,1) xe(i,2) xe(i,3) xe(i,4) xe(i,5) | q(i)\n'); fprintf('---|---------------------------------------------------+--------\n'); for i=1:6 fprintf(' %d |%8.4f %8.4f %8.4f %8.4f %8.4f %8.4f \n', i, xe(:, i), q(i)); end
e01tm example results | Interpolated Evaluation Points | Values ---|---------------------------------------------------+-------- i | xe(i,1) xe(i,2) xe(i,3) xe(i,4) xe(i,5) | q(i) ---|---------------------------------------------------+-------- 1 | 0.1000 0.1000 0.1000 0.1000 0.1000 3.2313 2 | 0.2000 0.2000 0.2000 0.2000 0.2000 4.2476 3 | 0.3000 0.3000 0.3000 0.3000 0.3000 5.2695 4 | 0.4000 0.4000 0.4000 0.4000 0.4000 6.3838 5 | 0.5000 0.5000 0.5000 0.5000 0.5000 7.6837 6 | 0.6000 0.6000 0.6000 0.6000 0.6000 9.3885