Account Options

  1. Sign in
The old Google Groups will be going away soon.
Switch to the new Google Groups.
Google Groups Home
« Groups Home
Variable substitution within n matrices
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Nicola Bressanin  
View profile  
 More options Jan 11, 7:58 am
Newsgroups: comp.sys.hp48
From: Nicola Bressanin <nicola.bressa...@gmail.com>
Date: Wed, 11 Jan 2012 04:58:36 -0800 (PST)
Local: Wed, Jan 11 2012 7:58 am
Subject: Variable substitution within n matrices
I needed a program to read a few 3x3 matrices containing
variables,like N and T.
N and T are stored in the same directory; when invoking the program
(SOST) the newer N and T are present on stack levels 1 and 2.I solved
it with ->NUM in this program,but was there another(better) way to do
it?is SUBST helpful?

SOST
<<
'T' STO
'N' STO
Rr1 Rr2 Rr3 Rr4
->NUM 'Rr4S' STO
->NUM 'Rr3S' STO
->NUM 'Rr2S' STO
->NUM 'Rr1S' STO
Rr1S Rr2S Rr3S Rr4S


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Han  
View profile  
 More options Jan 11, 12:21 pm
Newsgroups: comp.sys.hp48
From: Han <handuongs...@gmail.com>
Date: Wed, 11 Jan 2012 09:21:03 -0800 (PST)
Local: Wed, Jan 11 2012 12:21 pm
Subject: Re: Variable substitution within n matrices
On Jan 11, 7:58 am, Nicola Bressanin <nicola.bressa...@gmail.com>
wrote:

From the listing you posted, it appears that Rr1, Rr2, Rr3, and Rr4
are static. Suppose that Rr1 looks like:

[ [ 1 2 N ] [ 4 5 T ] [ 7 8 9 ] ]

You could use:

<<
  -> T N
  <<
    [ [ 1 2 N ] [ 4 5 T ] [ 7 8 9 ] ]
    ... insert the other 3 matrices here ...

  >>


This treats T and N as local variables. It takes T and N from the
stack, and then leaves four matrices with the T and N values
substituted into the matrices themselves for you to do whatever you
wish with them. This reduces the number of variables you have to keep
around in your directory.

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nemo  
View profile  
 More options Jan 11, 2:10 pm
Newsgroups: comp.sys.hp48
From: Nemo <carpentier.gil...@free.fr>
Date: Wed, 11 Jan 2012 11:10:27 -0800 (PST)
Local: Wed, Jan 11 2012 2:10 pm
Subject: Re: Variable substitution within n matrices
Hi, something like :

SOST :  «   -> T N L  «  L 1 « ->NUM ->NUM » DOLIST  » »

Example :

1 2 { Rr1 Rr2 Rr3 Rr4 } SOST

Eventually Followed by  { Rr1S Rr2S Rr3S Rr4S } STO

Of course you can put the list  in the SOST prog if it is always the
same matrices

Gilles


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nemo  
View profile  
 More options Jan 11, 2:54 pm
Newsgroups: comp.sys.hp48
From: Nemo <carpentier.gil...@free.fr>
Date: Wed, 11 Jan 2012 11:54:39 -0800 (PST)
Local: Wed, Jan 11 2012 2:54 pm
Subject: Re: Variable substitution within n matrices
Another way is to use the | function.  You can try this to
understand :

 Rr1 « {'N' 3 'T' 5 } | » MAP

| do substitutions in an algebraic object and MAP apply a program on
each element of a matrice.In this case, N become 3 and T become 5

| is very interessing, for example you can do such things : Rr1 « {'N'
'N+1' 'T' '2*T' } | » MAP


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nicola Bressanin  
View profile  
 More options Jan 13, 5:43 am
Newsgroups: comp.sys.hp48
From: Nicola Bressanin <nicola.bressa...@gmail.com>
Date: Fri, 13 Jan 2012 02:43:23 -0800 (PST)
Local: Fri, Jan 13 2012 5:43 am
Subject: Re: Variable substitution within n matrices
On 11 Gen, 20:54, Nemo <carpentier.gil...@free.fr> wrote:

> Another way is to use the | function.  You can try this to
> understand :

>  Rr1 « {'N' 3 'T' 5 } | » MAP

> | do substitutions in an algebraic object and MAP apply a program on
> each element of a matrice.In this case, N become 3 and T become 5

> | is very interessing, for example you can do such things : Rr1 « {'N'
> 'N+1' 'T' '2*T' } | » MAP

Thanks i'll try it

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »