Can app equations be indexed?
|
01-13-2017, 04:45 PM
Post: #1
|
|||
|
|||
Can app equations be indexed?
Provided with a suitable {list} of equations, does anyone know of a way to programmatically enter each of the equations into the Advanced Graphing App variables V0-V9? Some indexed way, via a loop construct, is the general idea.
Thanks, if you can help! -Dale- |
|||
01-13-2017, 05:04 PM
Post: #2
|
|||
|
|||
RE: Can app equations be indexed?
EXPR("V"+1+":="+QUOTE(L1(1)) ) ???
TW Although I work for HP, the views and opinions I post here are my own. |
|||
01-13-2017, 05:20 PM
Post: #3
|
|||
|
|||
RE: Can app equations be indexed?
On my side I've come up with:
Code: EXPORT AGV(list) You may need to check additionally that the input list doesn't have more than 10 elements. |
|||
01-13-2017, 05:46 PM
(This post was last modified: 01-13-2017 05:51 PM by DrD.)
Post: #4
|
|||
|
|||
RE: Can app equations be indexed?
I'll wrestle with that awhile. I had tried that with a list of string objects, which didn't work. Also, I just noticed that my string object list has lower case variables, and that's not going to work, either! Your idea seems work fine with a list of single quoted function objects, using upper case variables.
Thanks, Tim. I hope you had a nice Christmas and things go superbly in the new year! -Dale- Didier posted another idea, as I was preparing this response to Tim. I'll give that a try, as well. Thanks Didier! I always appreciate your clever ways and means! |
|||
01-13-2017, 08:35 PM
(This post was last modified: 01-13-2017 08:43 PM by Han.)
Post: #5
|
|||
|
|||
RE: Can app equations be indexed?
I've done this in Graph3D, but only using a single V0 to do temporary calculations and restoring the original content of V0. The format is just V0:=<string> where <string> is an actual string or a variable containing a string. It's also a way to quickly create a function.
The string itself needs to be a valid expression. Tim's suggestion works fine for a list strings. If you are running into issues with variables, you can create app variables using AVars("varname"):=0 and delete when with DelAVars (can be a list of strings corresponding to app variables, too). Code: ex:="2*x-3*y+myvar"; Then to delete, since varnames have been converted to strings, just use DelAVars(varnames); I have been using this scheme to program my own Equations Library and solver application that allows for any sort of variable. EDIT: In case it was not clear, once the app variables are created, you can use your string equations as already described by Tim and Didier without needing to convert to upper case or limiting yourself to single-letter variables. Graph 3D | QPI | SolveSys |
|||
01-14-2017, 09:13 PM
Post: #6
|
|||
|
|||
RE: Can app equations be indexed?
Thanks for all of your suggestions! I have a much better understanding of the details now. I combined several of the suggestions in this snippet program, which others might find useful down the line:
Code:
|
|||
01-14-2017, 09:50 PM
Post: #7
|
|||
|
|||
RE: Can app equations be indexed?
Your code could fail should a user set their number format to FIX or anything similar. You may want to use LEFT(STRING(I),1) or some variation of STRING with optional arguments.
Graph 3D | QPI | SolveSys |
|||
01-14-2017, 10:18 PM
Post: #8
|
|||
|
|||
RE: Can app equations be indexed?
Good point. I hadn't thought of that...
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)