Use should use subs() all at once (instead your variables are still symbolic) but below is another work around :
%此处如果不行可以单独拿出来
clc;
clear all;
close all;
syms n
h=2;%水深
D1=0.8060;%圆柱吃水深度
a=2.2497;%圆柱半径
%d=h-D1;%圆柱底部到水底的距离
d=1.1940;
%sn=n*pi/2*diff(besseli(0,n*pi*a/d),a)/(besseli(0,n*pi*a/d))
sn=(pi^2*n^2*besseli(1, (pi*a*n)/d))/(2*d*besseli(0, (pi*a*n)/d));
s0=vpa(subs(sn,n,0),5)
s1=vpa(subs(sn,n,1),5)
s2=vpa(subs(sn,n,2),5)
Gives:
s0 =
0.0
s1 =
3.7655
s2 =
15.818