定积分就要有积分下限和积分上限的, 但是你没提呀. 我假设了积分下限是0, 上限是这里得到的x,
代码如下:
x=randn(1,100)*sqrt(12);
while abs(mean(x))>=0.01|abs(var(x)-12)>=0.01
x=randn(1,100)*sqrt(12);
end
syms t z
f=int((1.87+t/20)*15.34+t/2+17,0,z)
y=subs(f,z,x);
subplot(211)
hist(x)
subplot(212)
hist(y)