J and variable variables 
Author Message
 J and variable variables

hi,

 I'd like to be able to define functions with some underlying
parameters.

These parameters are physically motivated (ie wavenumber, frequency
propogation speed , density.) and have a habit of showing
up in every possible place within an expression.

When I define my function ,
say
K=. 10

the function f_1 is hardwired with the value J found for K at that time.

I'd like to be able to observe variations in K (as well as the right
hand argument).  I know I could use the left hand argument, but in
most cases there are several parameters that I might like to examine,
and being new to J I'm hesitant (although not adverse) to 'functional'
approaches.

Perhaps the pure definition of a function only provides for looking at
a set of inputs and a set of outputs; Changing parameters would then
change the definition of the function.

Nonetheless,I'd like to heard from others who have similar needs and
come up with solutions that allow the user to vary parameters that
define said functions In a convenient manner.

thanks,
ira




Sat, 13 Jan 1996 00:38:26 GMT  
 J and variable variables

Quote:
> I'd like to be able to observe variations in K (as well as the right
> hand argument).  I know I could use the left hand argument, but in
> most cases there are several parameters that I might like to examine,
> and being new to J I'm hesitant (although not adverse) to 'functional'
> approaches.

   What you are looking for sounds like the table adverb.

   If :


   And you are interested in f for K=10,15,20, and 25 with right
   argument 2 then you would use f with the table adverb as follows :

   (10 15 20 25) f/ 2
0.408082j0.912945 0.154251j_0.988032 _0.666938j0.745113 0.964966j_0.262375

   And if you are interested in values of f for K=10 and right
   arugments 0,1, and 2 then :

   10 f 0 1 2
1 _0.839072j_0.544021 0.408082j0.912945

   -emmett



Fri, 12 Jan 1996 18:48:41 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Class variables / global variables / Init variables

2. awk variables --> shell variables

3. Variable "Variables"

4. concatenate two variables in a variable

5. Processing variable length/variable data files

6. variable contents to variable name

7. Variable Variables???

8. local variable and local variable in block behave differently

9. Variable variables in Ruby?

10. variable variables

11. Shared Variable Requirements The Shared Variable Working Group of the IEEE DASC is developing a

12. Local variables - lifetime and access variables [Q]

 

 
Powered by phpBB® Forum Software