Prev: eval begone!
Next: Finding
From: Sun Xianjun on
Hi, there is an error in the following codes,

>>syms deltax ;
>>Img(M+deltax,N+deltay);
% Img is a 2*2 matrix, M&N are common variables

??? Error using ==> subsindex
Function 'subsindex' is not defined for values of
class 'sym'.


I wanna solve an optimization problem, in which the
symbolic variables, deltax and deltay, are to be solved.
how can I deal with above?
From: Steven Lord on

"Sun Xianjun" <sxj_sun8110(a)163.com> wrote in message
news:fuh5e4$or2$1(a)fred.mathworks.com...
> Hi, there is an error in the following codes,
>
>>>syms deltax ;
>>>Img(M+deltax,N+deltay);
> % Img is a 2*2 matrix, M&N are common variables
>
> ??? Error using ==> subsindex
> Function 'subsindex' is not defined for values of
> class 'sym'.
>
>
> I wanna solve an optimization problem, in which the
> symbolic variables, deltax and deltay, are to be solved.
> how can I deal with above?

You can't use symbolic variables as indices into an array. How do you
decide which row of Img is the (deltax)th row? You can't, not without
giving a value for deltax -- and if you're going to do that, you don't need
to use a symbolic variable.

--
Steve Lord
slord(a)mathworks.com


 | 
Pages: 1
Prev: eval begone!
Next: Finding