www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/AiryFunctionOfRealValuedXExample.m

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

% Copyright 2015 The MathWorks, Inc.

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')