syms x y z
r=sqrt(x^2+y^2+z^2)
eta=acos(z/sqrt(x^2+y^2+z^2))
sta=atan(y/x)
[x,y,z]=solve(r,eta,sta)
想用 solve函数求出x,y,z的表达式 我的程序却不对 为什么~还有solve(‘r’,’eta‘,‘sta’)跟上面什么区别 系统中单引号什么作用 谢谢请高手指教 matlab新手
你现在代码的意思是求解方程组:
sqrt(x^2+y^2+z^2) = 0我想这应该不是你的本意吧,你是想求什么?
我想用 r eta sta 表示 x y z 可能我本来的代码也不对 总之 已知三个表达式 想要反求 x y z
追答 syms x y z r eta sta请问为什么你要处理一下这些基本公式并且 把将所由参数移到一边去 用f1 f2 f3 表示 我的那种方式不行呢
追答solve求解的是f(x)=0的方程,举个例子,要求x^2+2x=-1,应该写成
solve('x^2+2*x+1')你要求r=sqrt(x^2+y^2+z^2),当然要写成r-sqrt(x^2+y^2+z^2)的形式