fsolve要求所有内容都是double型,你这里r1,r2,r3
是sym变量,所以出错,改为下面:
f = @(n)sqrt(n2^2-n^2)*k0*H-atan(sqrt(n^2-n1^2)*k0/(sqrt(n2^2-n^2)*k0))-atan(sqrt(n^2-n3^2)*k0/(sqrt(n2^2-n^2)*k0));
>> fsolve(f,1.6)
fsolve要求所有内容都是double型,你这里r1,r2,r3
是sym变量,所以出错,改为下面:
f = @(n)sqrt(n2^2-n^2)*k0*H-atan(sqrt(n^2-n1^2)*k0/(sqrt(n2^2-n^2)*k0))-atan(sqrt(n^2-n3^2)*k0/(sqrt(n2^2-n^2)*k0));
>> fsolve(f,1.6)