Post Reply 
HP Prime: CAS Commands in Home Mode
12-21-2013, 12:39 AM
Post: #14
RE: HP Prime: CAS Commands in Home Mode
I'm going to add spacing into your command:

CAS("subst(k," X='x' ")" );

This makes no sense. Your arguments consist of three objects (a string, the expression X='x', and another string) simply juxtaposed. The other caveat is that what you substitute must not be pre-defined. So the global variables will not work. You can verify this is CAS view by typing: subs('X^2-1', X=2) and you will see the warning.

There are two approaches I know of:

Code:

EXPORT TEST(k)
BEGIN
k:="subst('" + k + "', x='t')" ;
CAS(k);
END;

This method requires you use a string for the input k (e.g. TEST("x^2-1") and use non-global variables). The next method (below) uses REPLACE().

Code:

EXPORT TEST(k)
BEGIN
k:=REPLACE(k, "X", "x");
k:="'" + k + "'"; // add quotes for non-evaluation
CAS(k); 
END;

Now, try typing TEST("X^2-1").

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HP Prime: CAS Commands in Home Mode - Han - 12-21-2013 12:39 AM



User(s) browsing this thread: 1 Guest(s)