'Solve' function getEqns input error

1 view (last 30 days)
I'm trying to approximate using Matlab.
So I input
syms x;
solve ('1.05 = 1000*10^(-19)*[10^(14)/2+sqrt([10^(14)/2]^2+2*10^19*(x/300)^(3/2)*10^19*(x/300)^(3/2)*exp(-1.1/(0.0259*[x/300])))]*100', x);
and get
??? Error using ==> solve>getEqns at 202
' 1.05 = 1000*10^(-19)*[10^(14)/2+sqrt([10^(14)/2]^2+2*10^19*(x/300)^(3/2)*10^19*(x/300)^(3/2)*exp(-1.1/(0.0259*[x/300])))]*100 ' is not a valid expression or equation.
Error in ==> solve at 67
[eqns,vars] = getEqns(varargin{:});
By trial and error I found value of x to be 465 and when I use matlab to solve this equation,
1000*10^(-19)*[10^(14)/2+sqrt([10^(14)/2]^2+2*10^19*(456/300)^(3/2)*10^19*(456/300)^(3/2)*exp(-1.1/(0.0259*[456/300])))]*100
I get 1.0491 which is close enough to 1.05
Does 'solve' need special type of input?
Thanks for help

Accepted Answer

Walter Roberson
Walter Roberson on 11 Feb 2013
[] means indexing in MuPAD, but your [] expressions do not follow a variable name.
In MATLAB and MuPAD, the precedence operator always () never [] .

More Answers (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!