You are doing a few things wrong. It makes no sense to use double for your two arguments in besselk and convert the output to symbolic. You should also avoid typing the old line into sym . Instead, you want to conditionally evaluate besselk (which will return about 1.02 Γ 10 2055 much more than realmax ), take the result log symbolically, and then convert it back to double precision.
The following is enough: if one or more input arguments are symbolic, the symbolic version of besselk will be used:
f = double(log(besselk(sym(750), sym(1))))
or in the old string form:
f = double(sym('log(besselk(750, 1))'))
If you want to keep your parameters symbolic and evaluate at a later time:
syms nu Z; f = log(besselk(nu, Z)) double(subs(f, {nu, Z}, {750, 1}))
Make sure you do not flip the nu and Z values ββin your math, since large orders ( nu ) are not very common.
horchler
source share