From: dpb on
Caglar Ozdag wrote:
> something like this:
>
>>> ns=int2str(17)
>>> xs=num2str(18)

>> help eval

EVAL Execute string with MATLAB expression.
EVAL(s), where s is a string, ...


Read the beginning help discussion carefully, paying most particular
attention to the modifier of "string". Even more specifically, the
number of inputs expected...then compare that to the number of
individual strings in the argument as it is written.

Then

help horzcat

--
From: Steven_Lord on


"Caglar Ozdag" <caglarozdag(a)gmail.com> wrote in message
news:i1tdp9$cg6$1(a)fred.mathworks.com...
> I can't figure out what it is that I'm doing wrong. eval() always returns
> with the same error, even in the simplest of executions.
>
>>> d = eval(ns,'+',xs)
> ??? Index exceeds matrix dimensions.
>>> eval('1/2')
> ??? Index exceeds matrix dimensions.
>
> Some guidance will be appreciated.

As others have suggested, you likely have a variable named EVAL in your
workspace and that is causing this error.

But if you'll forgive me a little bit of snarkiness, what you're doing wrong
IMO is that you're using EVAL at all. DON'T USE IT unless you ABSOLUTELY
need to use it. There are often alternate approaches that are preferable to
EVAL for various reasons.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com

First  |  Prev  | 
Pages: 1 2
Prev: boundary detection
Next: eval() Help