You are working with curves, not functions.
Your airfoil is a (planar) curve, or in the Splines toolbox wording a 2-valued, 1-variate spline function. This function is composed by two 1-valued, 1-variate functions which interpolate the pairs(t(i), x(i)) and (t(i), y(i)). With fnval(airfoil, s1) you are asking for the (x, y) coordinates for a value of t = 0.1.
You can see this if you plot the two components
airfoil_x = fncmb(airfoil, [1, 0]);
airfoil_y = fncmb(airfoil, [0, 1]);
figure(3)
clf
h1 = subplot(2,1,1);
fnplt(airfoil_y)
hold on
plot(t, y, 'o')
xlabel('t'), ylabel('y')
h2 = subplot(2,1,2);
fnplt(airfoil_x)
hold on
plot(t, x, 'o')
xlabel('t'), ylabel('x')
The point you asked for is found in these plots
errorbar(h1, s1, s2(2), s2(2) - h1.YLim(1), 0, 'k*')
errorbar(h2, s1, s2(1), s2(1) - h2.YLim(1), 0, 'k*')
And also in your original plot
figure(2)
plot(s2(1), s2(2), 'gsq', 'MarkerFaceColor', 'g')
If you want the point(s) over the airfoil at x = 0.1 you can do this:
- Find the zero(s) of the x-coordinate of your function minus the desired x-value
- Evaluate your funtion in those values of t
x0 = 0.1;
t0 = mean(fnzeros(fncmb(airfoil_x, '-', x0)), 1);
y0 = fnval(airfoil_y, t0);
airfoil_0 = fnval(airfoil, t0);
plot(h2, [0, 1], [x0, x0], 'g-')
errorbar(h2, t0, [x0, x0], [-5, -5], [5, 5], 'gsq', 'MarkerFaceColor', 'g')
h2.YLim = [0, 1];
h1.YLim = h1.YLim;
errorbar(h1, t0, y0, [-5, -5], [0, 0], 'gsq', 'MarkerFaceColor', 'g')