I used the following matlab code to solve a system of algebraic equations, but I got no answer.
clear; clc; close all;
syms x y z u
eqns = [2x + 1 == 2ux, 4y == 2uy, 6z == 2u*z, x^2 + y^2 +z^2 == 1];
S = solve(eqns,[x y z u]);
S.u
the result says:
ans =
Empty sym: 0-by-1
But there should be answers, to see the answers, please refer to an MIT calculus course: https://www.youtube.com/watch?v=nDuS5uQ7-lo&list=PLkcAPvx7T8bBOOuDcxZE_sdTchjQcTyM-&index=29
So , what is wrong?
solve(2*x+1==2*u*x, 4*y==2*u*y, 6*z==2*u*z, x^2+y^2+z^2==1)instead – David Aug 13 '20 at 01:23eqnsin the fourth equationx^2 + y^2 +z^2 ==1gets interpreted by Matlab as two different elements,x^2 + y^2andz^2==1. It needs a space beforez^2:x^2 + y^2 + z^2 ==1– David Aug 13 '20 at 01:28