Re: HP50g SigmaDat Message #8 Posted by Dave Britten on 8 Mar 2010, 1:17 p.m., in response to message #7 by Hal Bitton in Boise
Yup, Left-Shift SigmaDAT is a convenient way to store new data, as long as the variable already exists (or you've added its name to a custom menu). If not, you have to use a different approach.
Also, if you're going to work with multiple data sets, I'd recommend using the technique I mentioned earlier, i.e. storing the names of other variables into SigmaDAT. This will safeguard against a stack-clearing mishap destroying any of your data, or user error while shuffling data between variables. Also, the CLSigma command will only delete SigmaDAT, and not the underlying matrix variable holding the actual data, offering another layer of protection.
As an example, I wrote some programs for recording drive times of different routes, where each route is stored in its own matrix variable. The program prompts for a route name with 3 TVARS TMENU ... INPUT, then converts the resulting input string to a name and stores it in SigmaDAT. Then the program uses either Sigma+, or stores the data point directly into a new matrix if the named variable doesn't exist yet. The analysis/plotting routines do pretty much the same thing, minus creating new matrices.
Incidentally, you can do this same indirection with CST for saving custom menus. For example, I keep my normal custom menu in CST.DEFAULT, then store 'CST.DEFAULT' in CST. From there, I create submenus by invoking other CST.whatever list variables with TMENU. Thus I don't have to worry about a program's injudicious use of MENU deleting my permanent custom menus.
The one other place I can think of where this works is EQ - you can store the name of an algebraic variable, or a list of such variables. (This works with both the standard solver and multiple-equation solver.)
These indirection features aren't particularly obvious on the 48GX and newer models - I don't think the manual mentions it - but the way the variable catalog system works on the 48SX makes it second nature.
|