Trying to insert the numerical value of a variable:
clear; clc; syms x y z e1 = 2*x+z == 2; e2 = 2*y+z == 7.52; e3 = (z/(x+y+z))*(3.76/4.76)^(-1/2)*(1/4.76)^(-1/2) == 0.0244; [x,y,z] = vpasolve([e1, e2, e3], [x,y,z]); l = num2cell(x); m = num2cell(y); n = num2cell(z); disp(x); I = cell(3,4); I{1,1} = ' '; I{1,2} = 'a'; I{1,3} = 'b'; I{1,4} = 'c'; I{2,1} = 'Moles'; I{3,1} = 'Mole Fraction'; I{2,2} = l; disp(I);
The output of that looks like this:
So how may I have it so that the value of 'x' shows up in the 2v2 cellarray
Best Answer