在matlab中由几​个函数组合在一起形成​一个单变量函数怎么.​。

2 vues (au cours des 30 derniers jours)
logivel
logivel le 22 Nov 2022
clc
clear
syms D m Nx b a k
D=1;b=1;m=1;
a=1.7.*b
Nx=(k*pi^2*D)/b^2
af=((m^2*pi^2)/a^2+((Nx*m^2*pi^2)/(D*a^2))^0.5)^0.5;
bt=(-(m^2*pi^2)/a^2+((Nx*m^2*pi^2)/(D*a^2))^0.5)^0.5;
t=bt^2+(0.25*m^2*pi^2)/a^2
s=af^2-(0.25*m^2*pi^2)/a^2
f=2*t*s+(s^2+t^2)*cos(bt*b)*cosh(af*b)-(1/(af*bt))*(af^2*t^2-bt^2*s^2)*sin(bt*b)*sinh(af*b)
f1=inline('f','k')
k1=fsolve(f1,1,optimset('display','off'))
我像这边编为什么不出答案

Réponse acceptée

kiseped
kiseped le 22 Nov 2022
如果你的 f 没有单独写成 m 文件,而是直接在脚本中写的 f = @(x)。。。。,那么,调用的时候应该是:
fsolve(f,1,optimset('display','off'))

Plus de réponses (0)

Catégories

En savoir plus sur 数学 dans Help Center et File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!