%% Airy Function of Real-Valued x
% Define x.

x = -10:0.01:1;

% Calculate Ai(x)
%

ai = airy(x);

% Calculate Bi(x) using k = 2.
%

bi = airy(2,x);

% Plot both results together on the same axes.
%

figure
plot(x,ai,'-b',x,bi,'-r')
axis([-10 1 -0.6 1.4])
xlabel('x')
legend('Ai(x)','Bi(x)','Location','NorthWest')

% Copyright 2015 The MathWorks, Inc.