Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
subs in R2009a; not NaN?

Subject: subs in R2009a; not NaN?

From: Joerg Buchholz

Date: 15 Jan, 2009 17:17:02

Message: 1 of 3

Should the following R2009a substitution result in NaN?

>> syms x
>> y = (x^2 - 42*x)/(x - 42)
 
y =
 
-(42*x - x^2)/(x - 42)
 
>> subs (y, x, 42)
??? Undefined function or method 'charcmd' for input arguments of type 'double'.

Error in ==> sym.subs>oneSubs at 251
    x = charcmd(x);

Error in ==> sym.subs>mupadsubs at 162
    G = oneSubs(G,X{k},Y{k},yscalar(k));

Error in ==> sym.subs at 124
G = mupadsubs(F,X,Y);

Error in ==> sym.subs at 128
   G = subs(F,Y,X,0);
 

Subject: subs in R2009a; not NaN?

From: Nasser Abbasi

Date: 16 Jan, 2009 03:58:28

Message: 2 of 3


"Joerg Buchholz" <buchholz@hs-bremen.de> wrote in message
news:gknr2e$ahq$1@fred.mathworks.com...
> Should the following R2009a substitution result in NaN?
>
>>> syms x
>>> y = (x^2 - 42*x)/(x - 42)
>
> y =
>
> -(42*x - x^2)/(x - 42)
>
>>> subs (y, x, 42)
> ??? Undefined function or method 'charcmd' for input arguments of type
> 'double'.
>
> Error in ==> sym.subs>oneSubs at 251
> x = charcmd(x);
>
> Error in ==> sym.subs>mupadsubs at 162
> G = oneSubs(G,X{k},Y{k},yscalar(k));
>
> Error in ==> sym.subs at 124
> G = mupadsubs(F,X,Y);
>
> Error in ==> sym.subs at 128
> G = subs(F,Y,X,0);
>

Fyi; It DOES result in NaN on my 2008a Matlab. (I did not know there is now
new Matlab 2009a)
Here is the output I get

EDU>> syms x
EDU>> y = (x^2 - 42*x)/(x - 42)

y =

-(42*x - x^2)/(x - 42)

EDU>> subs (y, x, 42)

ans =

   NaN

EDU>> ver
-------------------------------------------------------------------------------------
MATLAB Version 7.7.0.471 (R2008b)


--Nasser

Subject: subs in R2009a; not NaN?

From: Joerg Buchholz

Date: 16 Jan, 2009 09:03:02

Message: 3 of 3

"Nasser Abbasi" <nma@12000.org> wrote in message
:
> Fyi; It DOES result in NaN on my 2008a Matlab. (I did not know there is now new Matlab 2009a)

Yap, a newborn baby bug; inglorious but true.

Tags for this Thread

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.

Contact us