How to build a non-linear system of three equations with 3 character variables in MATLAB?

I do not have much experience with Matlab. I know that you can build equations with two variables, such as:

ezplot(f1)
hold on
ezplot(f2)
hold off;

How would you build three equations with three symbolic variables ?

System example:

x^2+y^2+z^2-1=0
2*x^2+y^2-4*z=0
3*x^2-4y+z^2=0

It would be ideal if there was a way to build any system of three equations.

+1
source share
2 answers

I find it ezsurfclose to what you want. First you need to solve each equation for z, then make a function for this equation and build it with ezsurf. Here's how to do it using the first equation above:

func1 = @(x, y) sqrt(1-x.^2-y.^2);
ezsurf(func1);

.

, :

func1 = @(x, y) sqrt(1-x.^2-y.^2);
func2 = @(x, y) 0.5.*x.^2+0.25.*y.^2;
func3 = @(x, y) sqrt(4.*y-3.*x.^2);
ezsurf(func1, [-1 1 -1 1]);
hold on;
ezsurf(func2, [-1 1 -1 1]);
ezsurf(func3, [-1 1 -1 1]);
axis([-1 1 -1 1 0 1]);

:

enter image description here

, , , , .

+4

"hold on" , .

ezplot(f1);
hold on;
ezplot(f2);
ezplot(f3);
hold off;

ezplot, .

0

Source: https://habr.com/ru/post/1713477/


All Articles