MATRIXx

cancel
Showing results for 
Search instead for 
Did you mean: 

Plotting questions and the who command

Hello,
For your reference, I am using version 6.1.3.

1. The "who" command--is there a way to get xmath return variables in an alphabetized list? Looks like it returns variables as there are created in xmath, making it harder for me to find variables sometimes. Using the wildcard to find variables is helpful, just wondering if any other options exist for the who command or other similar commands.

2. Plot Legends--You can position the legend when in the plot window, but can you position the legend in Xmath (using a plot keyword)?

3. Plot Window--Can you have more than one plot window open at the same time?

Please let me know if any of these comments would be solved by using a newer version of Matrix X. If the latest ed
ition of Matrix X doesn't have these capabilities, they would be nice to have in the future.

Look forward to you response,
Jared
ps: the freeware editor program "Crimson" that Carl L. recommended works great editing Xmath files. There is already a syntax file for recognizing Matrix X keywords. I modified it a little and enjoy using that over Notepad!
0 Kudos
Message 1 of 6
(8,317 Views)
So where can one learn more about Crimson?

answer to 3, only way I found is to use the guiplot command.
0 Kudos
Message 2 of 6
(8,317 Views)
I used 6.1.3 on the PC and found several problems; one inparticular that I recall was the "Make Superblock" Command that seemed to mess up the connection order/names etc. I quickly updated to the 6.2.2 version. In those versions you can use something called qplot() I forget the path to get there but there are some good examples of its use within the source file. In one of the examples there is a keyword win="window number" e.g. win=1 (default) or win=2, etc. Then in Version 7 there is an expanded command that gives you additional functionality I believe called plot2d().

Garrett
Garrett Thurston
gthurston@foliage.com
Phone: 781.993.5540
0 Kudos
Message 3 of 6
(8,317 Views)
Addressing Question 1: As you pointed out who can be helpful to see the variables in the current partition or who partitionname.* will show you all variables of a partition or who *.* will show you variables in all partitions. But you can't do anything with it because it is only echo'd to the screen. However there is a command that you can find in the help and briefly in the manual and that is the directory command. E.g.:
who main.*
main:
a -- 1x3
b -- 1x1
c -- 1x1
d=directory("main.*")

d (a row vector of strings) = main.a main.b main.c

d'

ans (a column vector of strings) =

main.a
main.b
main.c

Now this is the fun part:


The directory command actually uses a different command to achieve this and in the right circumstances this is handy in scripting:

[out=format] === who main.*

The use of the === comes in handy for lots of purposes to find out more about it go to:P6-35-36 of the Xmath Basics Manual.

Then you can use the output and parse it like you would anyother output to sort etc.

Garrett
Garrett Thurston
gthurston@foliage.com
Phone: 781.993.5540
0 Kudos
Message 4 of 6
(8,317 Views)
As TWK is probably aware both qplot and plot2d are based upon guiplot.

Garrett
Garrett Thurston
gthurston@foliage.com
Phone: 781.993.5540
0 Kudos
Message 5 of 6
(8,317 Views)
Crimson is a freeware text editor with syntax highlighting. More information can be found at http://www.crimsoneditor.com/. There are many other editors with the same capability. Ussually you need to know the set of keywords (function and command names) as well as a set of rules (what marks a comment).

Crimson comes with a set of files for MathScript. The attached files are more complete and also include support TPL. There are some limitations to be aware of.
1. In a string " is used to both start/stop the string as well as an escape character. For example "String with "n line feed". Crimson will assume the string ends at "n.
2. For TPL the use of @ for everything causes some problems. I got the best results by highlighting comments and ignor
ing the difference between plain text and TPL statements. Most of the TPL statements will still have color as the keywords are highlighted. However parts of TPL will not have color and plain text could have color if it contains a TPL keyword.

Unzip the attached file to the installation directory of Crimson. The files with .spc and .key extensions will be placed in the spec directory. And the extension.* files will be place in the link directory.

Let me know what you think.

Carl L
National Instruments
0 Kudos
Message 6 of 6
(8,317 Views)