Thread Subject: error with eval

Subject: error with eval

From: Alex

Date: 16 Jan, 2008 09:46:02

Message: 1 of 2

Hey,
I am using the eval function in combination with the solve
function, as can be seen in the following:

syms x % Setting x as an unknown
Equation = eta_p/(climb_rate_ms+(sqrt(OptimumWS)*sqrt
(2/rho_sea)/((1.345*(x*e)^0.75)/CD_0^0.25)))-OptimumWP;
A_clr_opt = eval(solve(Equation));

(Matlab finds Equation to be equal to:
Equation =
4/5/
(1143/125+1914868778638812090507823564875/36630645762454402
33426508578816*33^(1/4)*40^(3/4)/x^(3/4))-
3969249135925473/36028797018963968 )

However, I get the following error message:

??? Error: This statement is incomplete.

Error in ==> sym.eval at 9
s = evalin('caller',map2mat(char(x)));

Error in ==> RegionalTurboprop at 180
A_clr_opt = eval(solve(Equation))

I use the eval(solve())in a couple of more cases in my
code and only this one gives me an error. What's wrong?

Thanx in advance,
Alex

Subject: error with eval

From: Anh Huy Phan

Date: 16 Jan, 2008 15:56:02

Message: 2 of 2

"Alex " <alex.thomos@gmail.com> wrote in message
<fmkjoq$laf$1@fred.mathworks.com>...
> Hey,
> I am using the eval function in combination with the solve
> function, as can be seen in the following:
>
> syms x % Setting x as an unknown
> Equation = eta_p/(climb_rate_ms+(sqrt(OptimumWS)*sqrt
> (2/rho_sea)/((1.345*(x*e)^0.75)/CD_0^0.25)))-OptimumWP;
> A_clr_opt = eval(solve(Equation));
>
> (Matlab finds Equation to be equal to:
> Equation =
> 4/5/
> (1143/125+1914868778638812090507823564875/36630645762454402
> 33426508578816*33^(1/4)*40^(3/4)/x^(3/4))-
> 3969249135925473/36028797018963968 )
>
> However, I get the following error message:
>
> ??? Error: This statement is incomplete.
>
> Error in ==> sym.eval at 9
> s = evalin('caller',map2mat(char(x)));
>
> Error in ==> RegionalTurboprop at 180
> A_clr_opt = eval(solve(Equation))
>
> I use the eval(solve())in a couple of more cases in my
> code and only this one gives me an error. What's wrong?
>
> Thanx in advance,
> Alex

If your Equation has not any analytical solution, the output of
function 'solve' is empty, and the function 'eval' will return
this error.

It could be avoided by using 'double'

A_clr_opt = double(solve(Equation))

Anh Huy Phan
RIKEN - BSI



Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
eval Alex 16 Jan, 2008 04:49:58
solve Alex 16 Jan, 2008 04:49:58
rssFeed for this Thread

Public Submission Policy

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Disclaimer prior to use.

Contact us at files@mathworks.com