Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Solve the above set of equations symbolically by \"solve\" command. Follow below

ID: 3884968 • Letter: S

Question

Solve the above set of equations symbolically by "solve" command. Follow below, study how it works. It is easier to copy/paste these in a new m-file. In that case, you wouldn't need to retype in case of errors. syms x y z % Define symbols x, y, z. eq1 = x + 2*y + 3*z - 4 % Move all arguments to one side: so that eq1 = 0 ... % Do the same for the other two equations. [xx, yy, zz] = solve (eq1, eq2, eq3, x, y, z) % Solve equations symbolically % Note order of variable names. % The answers are rational numbers (long fractions) convert to decimal: xx = double (xx) % Repeat for yy, zz.

Explanation / Answer

syms x y z
eqn1 = x + 2*y + 3*z == 4;
eqn2 = -x + y - z == 6;
eqn3 = x + 2*y + 2*z == 5;
[xx,yy,zz]=solve(eqn1,eqn2,eqn3,x,y,z);%assign the output to the variable
xx=double(xx); %converting into double
yy=double(yy);
zz=double(zz);
disp(xx); %display the result
disp(yy);
disp(zz);

output:

-1

4

-1

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote