自己实现MATLAB支持向量化输入输出的零阶修正贝塞尔函数

function [ y ] = Bessel0( x )
% 此函数用于计算0阶修正贝塞尔函数值
% 支持向量化输入输出
% 作用相当于MATLAB自带的库函数besseli(0,x)
theta =0.001:0.001:2*pi;
length(theta);
t= repmat(x, length(theta), 1);
t= reshape(t,1,[]);
theta= repmat(theta, 1, length(x));
t= t .* cos(theta);
t=reshape(t, [], length(x));
y=0.001/(2*pi) *sum(exp(t), 1);
end


发布了44 篇原创文章 · 获赞 16 · 访问量 6万+

猜你喜欢

转载自blog.csdn.net/qq_32464407/article/details/71087725
今日推荐