HP Forums

Full Version: Programming help: MAKEMAT in CAS
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
What am I doing wrong here?

In a program, I have:

Quote:LOCAL flist = {'2*x+y', 'y', 'x^2'};
LOCAL vlist = {'x', 'y'};
CAS(EXPR("jac:=MAKEMAT(0," + SIZE(flist) + "," + SIZE(vlist) + ")"));
MSGBOX(CAS.jac);

The message box says "jac". I'm expecting a matrix.

I've tried so many different permutations of this recipe. I just can't understand how to perform this simple task.
Well, for starters CAS won't recognize LOCAL variable assignments. Also, you need to enclose the entire expression in double quotes " ", i.e. CAS(" <expr> ")
See the bottom of the thread linked below:

http://www.hpmuseum.org/forum/thread-132.html
(12-20-2013 07:30 PM)Han Wrote: [ -> ]See the bottom of the thread linked below:

http://www.hpmuseum.org/forum/thread-132.html

Thanks. Your post basically confirms what I've come to realise over the past week: the programming language is seriously broken, ugly and unintuitive when it comes to any kind of symbolic manipulation.

I've decided to give up programming the Prime for now as it's too much work for the simple things I'm trying to achieve.
Reference URL's