HP Forums

Full Version: Interesting TI Nspire CAS CX programming features
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

Hi All,

I decided to tinker with the TI Nspire CAS CX calculator and do some programming. The first feature that caught my attention is the ability to prompt for an equation (as a function of x). This allows one to write numerical analysis routines (e.g for solving roots and calculating the area under the curve) for equations that the user enters at run-time!

The other feature is the creation of matrices and vectors by a program. Here, I had to use a trick to first create an identity square matrix and then over-writing its elements with different values. To create a vector that has the same number of rows as a square matrix, I first create a vector made up of the diagonal elements of the square matrix and then assign new values to the vector.

Interestingly, the TI Nspire programming model regards vectors as either column matrices or row matrices. This means that when you access the elements of a vector you have to specify both the row and column indices. This dual orientation has to be monitored during the program development phases so you can correctly access the elements of a vector either as a row or a column matrix.



Watch it out! Working too long with the CX makes you addicted and you quit using HP calculators...

Have a great weekend and happy programming!


The worse part is that I am working with the Teacher version of the CAS CX emulator. So typing in the source code is a easier than on the machine.

The ability to declare variable and parameter names that are longer than one or two letters is also addictive!!!


The equation prompting part has been possible on the 50g for ever. Like so:

<< "Y=" PROMPT 'EQ' STO >>

Then you can go on solving or whatever you like to do with that equation.

Way super cool Alexander!!! Thanks for the tip!


I did find the newMat command to create matrices of any size and with zeros as initial value for the matrix elements. The TI Nspire has the construtMat function that creates a matrix of any size and fill its values based on a user-defined expression that uses the indices of the rows and columns. For example,


creates a matrix, A, with 3 rows and 4 columns. The value of each element A(i,j) is based on the values of row index i and column index j using the expression 1/(i+j).

Finally, the function randMat creates a matrix of any size with random values in its elements.


Edited: 15 Apr 2012, 4:23 p.m.