MATLAB: How to write a Bessel function but with the own set values

bessel functionbessel helpmatlab r2018plot help

clc,clear,clf
ka = [0.05, 0.1, 1.0, 2.5, 5.0, 7.5, 10]
theta = 0:pi;
nu = ka.*sin(theta)
H = abs((2*besselj(0,nu))/(nu));
figure(1)
fplot(H)
axis([0 12 -0.5 1.1])
grid on
origial formula is abs(2*J(nu)/(nu)) with nu=ka*sin(theta)
I get an error message "Matrix dimensions must agree"
and if i do theta = 0:2*pi; I get a straight line.

Best Answer

"ka" is 1x6, "theta" is 1x4. What do you expect "nu" to be ?
At least you will have to set
H = abs(2*besselj(0,nu)./nu);
Best wishes
Torsten.