The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Changing Matrix Coordinates

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
tib Posted - 01/29/2002 : 2:37:37 PM
I want to set the matrix coordinates via script;
When creating a new matrix the default is 1 to 32 in both x and y direction.
When running the following test script
matrix -pg X aaa bbb;
matrix -pg Y ccc ddd;
type $(aaa) $(bbb) $(ccc) $(ddd);
aaa=111; bbb=222; ccc=333; ddd=444;
matrix -ps X $(aaa) $(bbb);
matrix -ps Y $(ccc) $(ddd);
aaa=0; bbb=0; ccc=0; ddd=0;
matrix -pg X aaa bbb;
matrix -pg Y ccc ddd;
type $(aaa) $(bbb) $(ccc) $(ddd);

I get the following results:
First run:
1 10 1 10 but it should be 1 32 1 32
111 222 333 444 but the real values in the dialog are 111 32 333 32

Second run:
111 222 333 444
111 222 333 444 but the real values are still 111 32 333 32

After having changed a number by hand in the matrix dimension dialog
the above script works. But this is not the purpose of a script.
Is there any initialization necessary? What am I doing wrong?
Thanks, Tilman.
7   L A T E S T    R E P L I E S    (Newest First)
lanne Posted - 01/31/2002 : 11:28:30 AM
Well I'm wondering if there is not a confusion between the indexes of the matrix on one side and X and Y on the other side.

When one do what Mike told us:
matrix -ps X 1 100;
matrix -ps Y 1 100;
And open the Set Dimensions dialog, it definitely shows the good results. The dimention of the matrix is indeed 32x32 and the X and Y "Last" coordinates show up 100.

And if you type:
matrix -v x+y;

the last bottom/right element of the matrix will show 200 (and not 64 as expected above). Because to the last row number of the matrix corresponds Y=100 and to the last column number of the matrix corresponds X=100.

In that way everything works quite good and the results of tib's script are the good ones...

Edit - I just checked that its works exactly the same way in 6.0 and 7.0

Edited by - lanne on 01/31/2002 11:42:47
Laurie Posted - 01/31/2002 : 10:46:41 AM
Ok, now I see the problem in 6.1 SR4, and yes it's just a problem with the dialog. The X and Y values do get set. (If you use the dialog to enter values, it looks to work ok as well.) It looks like we've fixed the problem in 7.0.

OriginLab Technical Support
Mike Buess Posted - 01/30/2002 : 4:29:38 PM
Hi Laurie,

Yes, I think we all agree now that matrix -ps works as advertised. But there's something wrong with the Set Dimensions dialog. The values it shows are not the true values. Perhaps the dialog isn't being initialized properly? (Just a guess.)

Quick example:
Open a new matrix window.
matrix -ps X 1 100;
matrix -ps Y 1 100;
Open Set Dimensions dialog... The X and Y "Last" coordinates show up as 32 instead of 100.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 01/30/2002 16:35:04
Laurie Posted - 01/30/2002 : 4:11:15 PM
It seems to work as expected.

matrix -pg and matrix -ps take three parameters: DIM X Y

Dim will return or set the dimensions. X and Y will set the First and Last coordinates.

OriginLab Technical Support
Mike Buess Posted - 01/30/2002 : 3:22:29 PM
Tilman,
quote:
You mentioned the matrix commands. ...
I was just referring to matrix -ps, which seems to work fine. I guess what I really meant was that it's safe to ignore the Set Dimensions dialog.

I haven't tried irregular spacings and don't work with matrices enough to suggest anything useful. Anyone else have ideas?

Mike Buess
Origin WebRing Member
tib Posted - 01/30/2002 : 02:31:45 AM
Hi Mike,
thanks for your comments. Yes, you're right it's not necessary to use the substitution notation. The actual example was like matrix -ps X %(WksName,ii,jj) %(WksName,ii,jj-1);
Since the first value was right in the dialog, but always the latter have been wrong, I thought, that maybe the hole thing was interpreted as a string, and I tried $(%(%WksName,ii,jj).. and many other things...
So, after wasting hours and trying many things I have to admit that because of the wrong numbers in the dialog, I didn't even try to plot the data. But maybe I should have done this that regardless.

You mentioned the matrix commands.
Of course I would prefer a command like "MatName!mat.xmin=1" and the same for xmax, ymin, and ymax.
But I couldn't find such a command (once more again ) in my printed manual. Are there such of this kind?

By the way, do you know how one can handle irregular spacings in matrices?
For example if the x or y values are not equally spaced, let's say 0,1,2,5,10,20,50,100,200,500.
I don't want to use logarithmic scale.
In a worksheet, I can set this column to Text and then I have equal spaces in the plot but still the right labeling. How can I do this in a 2D plot, i.e. in a matrix?
Thanks, Tilman.
Mike Buess Posted - 01/29/2002 : 11:10:13 PM
Hi Tilman,

I think the "Set Dimensions" dialog contains the wrong numbers. I went through your example and got the same results. But when I put numbers in the matrix and plotted in 3D the X and Y axes were labelled according to matrix -ps X and Y values. There's obviously a bug here somewhere, but it looks like its safer to go with the matrix commands.

By the way, why do you use substitution notation in the matrix -ps commands? Just curious.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 01/29/2002 23:13:21

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000