MATLAB: How to solve system of equations in Matlab R2018b

equationsolveSymbolic Math Toolboxsystem

Hello, I'm trying to solve a system of 3 equations, e.g.:
eqtau01=('(W14sol-W20sol)/(W15-W20sol)=tau01'); %equazione di willis tra 15 e 14
eqtau02=('(W14sol-W20sol)/(W12-W20sol)=tau02'); %equazione di Willis tra 14 e 12
eqtau03=('(W13sol-W20sol)/(W12-W20sol)=tau03'); %equazione di Willis tra 13 e 12
solT=solve(eqtau01,eqtau02,eqtau03,'W13sol','W14sol','W20sol');
Of course I've already defined: W12, W15, tau01, tau02 and tau03.
So the unknows are only: W13sol, W14sol and W20sol.
The output is:
Error using solve>getEqns (line 418)
List of equations must not be empty.
Error in solve (line 226)
[eqns,vars,options] = getEqns(varargin{:});
Error in untitled2 (line 78)
solT=solve(eqtau01,eqtau02,eqtau03,W13sol,W14sol,W20sol);
How can I solve it correctly in Matlab R2018b?
Thanks!

Best Answer

syms W13sol W14sol W20sol
W15=6; % an example of datas
W12=8;
tau01=9;
tau02=10;
tau03=11;
eqtau01=((W14sol-W20sol)/(W15-W20sol)==tau01); %equazione di willis tra 15 e 14
eqtau02=((W14sol-W20sol)/(W12-W20sol)==tau02); %equazione di Willis tra 14 e 12
eqtau03=((W13sol-W20sol)/(W12-W20sol)==tau03); %equazione di Willis tra 13 e 12
solT=solve(eqtau01,eqtau02,eqtau03,W13sol,W14sol,W20sol);
solT.W13sol % to view solution
%or the below in one line to view all the solutions at once
[W13sol,W14sol,W20sol]=solve(eqtau01,eqtau02,eqtau03,W13sol,W14sol,W20sol); % if you are lazy to do the next step as mentioned above