math - How can I plot 3 equations with 3 variables in MATLAB? -
i trying plot system:
x1 - x2 + 3x3 = 8 2x1 - x2 + 4x3 = 11 - x1 + 2x2 -4x3 = -11
i tried ezsurf
, meshgrid
, wasn't able it.
clc clear close = [1 -1 3; 2 -1 4; -1 2 -4]; b = [8 11 -11]'; c = [a b]; r = rref(c); % r = % 1 0 0 1 % 0 1 0 -1 % 0 0 1 2 d = r(:,4); % salvo la 4 colonna che contiene le soluzioni disp('le soluzioni del sistema proposto sono:'); disp(d); figure(1); hold on grid on syms x y z eq = x + y + 3*z - 8; z = solve(eq,z) ezsurf('8/3 - y/3 - x/3'); scatter3(d(1),d(2),d(3));
how can plot system of equations?
maybe i'm missing something, have 3 unknown x1
, x2
, x3
3 equations, therefore there unique solution (provided determinant of matrix not zero):
>> = [1 -1 3; 2 -1 4; -1 2 -4]; >> b = [8 11 -11]'; >> x = a\b x = 1 -1 2
so there nothing plot other single point?
Comments
Post a Comment