'Solve' function getEqns input error

2 ビュー (過去 30 日間)
Anthony Naumenko
Anthony Naumenko 2013 年 2 月 11 日
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

採用された回答

Walter Roberson
Walter Roberson 2013 年 2 月 11 日
[] means indexing in MuPAD, but your [] expressions do not follow a variable name.
In MATLAB and MuPAD, the precedence operator always () never [] .
  1 件のコメント
Anthony Naumenko
Anthony Naumenko 2013 年 2 月 11 日
Thanks alot!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeNumeric Solvers についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by