필터 지우기
필터 지우기

How to use the solve function?!!

조회 수: 1 (최근 30일)
Alex Mannings
Alex Mannings 2013년 11월 19일
댓글: Alex Mannings 2013년 11월 19일
Hi Everyone, this is my second question since the first one i stated it with a mistake.
I am trying to solve this equation for Mx :
nux= ((gam+1)/(gam-1))^(1/2) * atan(((gam-1)/(gam+1))*(Mx^2-1))^(1/2)-atan(Mx^2-1)^(1/2);
The values of nux and gam are given.
I tried solve this equation using the solve function (according to http://www.mathworks.com/help/symbolic/solve.html this link) but it didn't work, this is how i wrote it:
Mx=solve(nux-((gam+1)/(gam-1))^(1/2) * atan(((gam-1)/(gam+1))*(Mx^2-1))^(1/2)-atan(Mx^2-1)^(1/2)==0, Mx, 'Real');
The error that i kept getting was:
"Cannot find an exact (case-sensitive) match for 'Mx'
The closest match is: mx in C:\Program Files\MATLAB\R2012a\toolbox\robust\rctobsolete\mutools\commands\mx.m"
Please help me fix this problem, because i need the solution for that equation asap.
Thank you.

답변 (1개)

Walter Roberson
Walter Roberson 2013년 11월 19일
syms Mx
output_MX = solve(nux-((gam+1)./(gam-1)).^(1/2) * atan(((gam-1)./(gam+1)).*(Mx.^2-1)).^(1/2)-atan(Mx.^2-1).^(1/2)==0, Mx, 'Real');
  댓글 수: 1
Alex Mannings
Alex Mannings 2013년 11월 19일
Thank you Walter, your change did get the code to move little bit but i got this error now:
Error using solve>processOnOff (line 294)
'Real' requires a value.
Error in solve>getEqns (line 257) [k, options] = processOnOff(k, options, v, vc, nargin, varargin);
Error in solve (line 150)
[eqns,vars,options] = getEqns(varargin{:});
Error in DDcode (line 36)
output_MX = solve(nux-((gam+1)./(gam-1)).^(1/2) * atan(((gam-1)./(gam+1)).*(Mx.^2-1)).^(1/2)-atan(Mx.^2-1).^(1/2)==0, Mx, 'Real');

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by