关于求psi(10*x)中x的方法。

psi(1.7)=0.2085
但是s=solve('psi(10*x)-0.2085=0','x')求出来的结果不是1.7 是为什么

 Réponse acceptée

cosas
cosas le 19 Nov 2022

0 votes

这很有意思,psi应该是不接受负数作参数的吧?
用s=solve('psi(10*x)-0.2085=0','x')可以算出来
s =
-226.98740242646891529702242417634
但是psi(10*(-226.98740242646891529702242417634))会报错
而psi(10*s)却能算出来
不知道这是不是matlab的一个bug
另外,你可以试试fzero求解,这个没问题:y=@(x)psi(10*x)-0.2085;
fzero(y,1)

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB 快速入门 dans Centre d'aide et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!