问个MATLAB画图的问题

来源:百度知道 编辑:UC知道 时间:2024/05/19 09:14:00
我有一个方程组(我随便举的例子),
sin(x+y)=z+y
cos(y+z)=y+0.1
我现在要画z关于x的图,怎么编程序
我试图用solve通过解方程求出 y再代入另一个式子中,再用ezplot画,但是解方程求y这一步用solve行不通,请问怎么弄

you can try to solve the two functions jointly by looking at y as a parameter:

>> syms x y z
>> [x,z]=solve(sin(x+y)-(y+z),cos(y+z)-(y+.1),x,z)

x =

-y+asin(acos(y+1/10))

z =

acos(y+1/10)-y

By the way, I should recommend you try Mathematica for these symbolic problems. As an example, in this problem, let's assume x,y and z are real numbers. By using Mathematica, it is very easy to determine that the range of parameter y is: -.1+cos(1)<= y <=.9 . But in Matlab, it is not trivial.

完成了部分,回家接着来。
y=-1.1:0.01:0.9
ezplot('cos(y+z)-y-0.1 ')