Interesting TI Nspire CAS CX programming features - Printable Version +- HP Forums (https://archived.hpcalc.org/museumforum) +-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html) +--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html) +--- Thread: Interesting TI Nspire CAS CX programming features (/thread-217833.html) Interesting TI Nspire CAS CX programming features - Namir - 04-14-2012 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. Namir Re: Interesting TI Nspire CAS CX programming features - Joerg Woerner - 04-14-2012 Namir, 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! Cheers, Joerg Re: Interesting TI Nspire CAS CX programming features - Namir - 04-14-2012 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!!! Namir Re: Interesting TI Nspire CAS CX programming features - Alexander Oestert - 04-15-2012 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. Re: Interesting TI Nspire CAS CX programming features - Namir - 04-15-2012 Way super cool Alexander!!! Thanks for the tip! Namir Re: Interesting TI Nspire CAS CX programming features - Namir - 04-15-2012 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, constructMat(1/(i+j),i,j,3,4)->A 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. Namir Edited: 15 Apr 2012, 4:23 p.m.