Error trying to solve an equation
4 ビュー (過去 30 日間)
古いコメントを表示
I'm trying to write a script to find a decision boundary between two classes which are distributed as 2-dimensional normal distributions. Here is my script (the estimated mean and covariance matrices are calculated previous to this running):
e = exp(1);
syms x;
sig1_det = det(sigma1_est);
sig2_det = det(sigma2_est);
zero = solve(1/(sig1_det^(1/2))*exp(-1/2*(x-mu1_est)\sigma1_est...
*(x-mu1_est)') == 1/(sig2_det^(1/2))*exp(-1/2*(x-mu2_est)\...
sigma2_est*(x-mu2_est)'), x);
However, when I run this, I get an error on the line with the "solve" call. Here's the error(s):
Error using mupadmex Error in MuPAD command: Operands are invalid. [linalg::matlinsolve]
Error in sym/privBinaryOp (line 835) Csym = mupadmex(op,args{1}.s, args{2}.s, varargin{:});
Error in \ (line 284) X = privBinaryOp(A, B, 'symobj::mldivide');
Error in script (line 6) zero = solve(1/(sig1_det^(1/2))*exp(-1/2*(x-mu1_est)\sigma1_est...
What'd I do wrong?
0 件のコメント
回答 (1 件)
Roger Stafford
2015 年 3 月 24 日
編集済み: Roger Stafford
2015 年 3 月 24 日
I see a couple of dubious entities in your expression to be solved. First, you have used the backslash symbol, '\', which doesn't seem to belong there, and second, you have used a quote sign: (x-mu1_est)') in two places, and that is inappropriate, too.
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!