COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### ??? Undefined function or method 'gt' for input arguments of type 'sym'.

• Follow

```a = solve('-4.4159e-005*x^2+-0.00065039*x+0.0008699=0')
Output is passed to the following function
min=-10
max=10
values = a

function inrangeValue = checkRange(min, max,values)
for i=1:length(values)
if (values(i)>min) && (values(i)<max)
inrangeValue=values(i);
end
end

I'm getting a error: ??? Undefined function or method 'gt' for input arguments of type 'sym'.

What is the reason for this?
```
 0

```gt means greater >
so you use > for symbolic experessions

------------------------------------
Maxim Vedenev, Matlab freelancer
vedenev@ngs.ru
http://simulations.narod.ru/

```
 0
Reply vedenev.maxim (308) 7/14/2010 5:51:37 AM

```vedenev <vedenev.maxim@gmail.com> wrote in message <db3b36c8-72f8-413a-96cd-0221727d9871@g19g2000yqc.googlegroups.com>...
> gt means greater >
> so you use > for symbolic experessions
>
> ------------------------------------
> Maxim Vedenev, Matlab freelancer
> vedenev@ngs.ru
> http://simulations.narod.ru/
>

No. I found the reason because the out precision of solve is very high, If we reduce the digits of precision we can avoid the error.

Thanks,

Regards,
Paheerathan
```
 0

```"M Paheerathan" <mp.mscproject@yahoo.com> wrote in message
news:i1jhel\$gso\$1@fred.mathworks.com...
>a = solve('-4.4159e-005*x^2+-0.00065039*x+0.0008699=0')
> Output is passed to the following function
> min=-10
> max=10
> values = a
>
> function inrangeValue = checkRange(min, max,values)
> for i=1:length(values)
>    if (values(i)>min) && (values(i)<max)
>        inrangeValue=values(i);           end
> end
>
>
> I'm getting a error: ??? Undefined function or method 'gt' for input
> arguments of type 'sym'.
>
> What is the reason for this?

Because the greater-than operator (>) is not defined for sym objects and GT
is the name of the function form of that operator.  [If x and y were
arbitrary symbolic variables, what should x > y return if > were defined for
sym objects?]

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
http://www.mathworks.com

```
 0
Reply slord (13276) 7/14/2010 2:22:15 PM

3 Replies
1566 Views

Similiar Articles:

7/20/2012 4:59:58 PM