为了账号安全,请及时绑定邮箱和手机立即绑定

想要得到fn=0时的a,b,z,x. 求具体的代码~

想要得到fn=0时的a,b,z,x. 求具体的代码~

慕姐8265434 2022-06-17 17:11:12
m=cell(20,5)for a=0.7;0.1:2for b=0.1:0.1:0.8for z=0.1:0.1:0.7for x=8:2:20f=0 ,fn=0for n=1:(x/2-1)f=1000./(x/2-1).*(0.7-z)./((z-0.7).*(sqrt(a^2-b^2-4.*a.*sqrt(0.16-b^2/4)-1.32)./1.96)-(sqrt(0.16-b^2/4))+(sqrt(0.16-(n.*b./x)^2)))fn=fn+fendif fn==0i=i+1cell{i,1}=acell{i,2}=bcell{i,3}=zcell{i,4}=xcell{i,5}=fnendendendendend
查看完整描述

1 回答

?
蛊毒传说

TA贡献1895条经验 获得超3个赞

m=cell(20,5)
for a=0.7;0.1:2
for b=0.1:0.1:0.8
for z=0.1:0.1:0.7
for x=8:2:20
f=0 ,fn=0
for n=1:(x/2-1)
f=1000./(x/2-1).*(0.7-z)./((z-0.7).*(sqrt(a^2-b^2-4.*a.*sqrt(0.16-b^2/4)-1.32)./1.96)-(sqrt(0.16-b^2/4))+(sqrt(0.16-(n.*b./x)^2)))
fn=fn+f
end
if fn==0
i=i+1
m{i,1}=a; % m,不是cell
m{i,2}=b;
m{i,3}=z;
m{i,4}=x;
m{i,5}=fn;
end
end
end
end
end
m

查看完整回答
反对 回复 2022-06-20
  • 1 回答
  • 0 关注
  • 186 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信