AnsweredAssumed Answered

Re2: Searching the HPIB-bus for connected instruments.

Question asked by VRFuser on Jan 18, 1999
Drago, William wrote:
>
> Hi All,
>
> I'm trying to replace the values in 1 dimension of a 2 dimensional
> array with values from a 1 dimensional array.
>
> Other than looping thru the arrays, replacing 1 element at a time, is
> there a better way to do this?
>
> :-:--------------------------:-:
>  :        Bill Drago          :
>  |      L3 Communications     |
>  :    Narda Microwave-East    :
>  |     Hauppauge, NY 11788    |
>  :  William.Drago@L-3Com.com  :
>  |     516-231-1700 x572      |
> :-:--------------------------:-:

Yes:


+--------------------------------+      +----------------------+
|       Generate 1D Array        |      |       Formula        |
+--------------------------------+      +----+-----------------+
| randomize( ramp(10,0,0),0,50 ) +----->| A1 | [ A1, A2[1,*] ] +--->
+--------------------------------+  +-->| A2 |                 |
                                     |   +----+-----------------+
                                     |
                                     +-----------------------------------+
                                                                         |
+--------------------------------------------------------------------+  |
|                         Generate 2D Array                          |  |
+--------------------------------------------------------------------+  |
| [ randomize(ramp(10,0,0),50,100), randomize(ramp(10,0,0),100,150)] +--+
+--------------------------------------------------------------------+

Don't worry about the boxes with the "randomize(ramp)" statements in them,
they just generate arrays with random contents (in distinct ranges so
you know which is which).  The Formula box is the important item.

This Formula swaps the first row of the array.  You can swap the second
with:


    [ A2[0,*], A1 ]


[%%] regards -- gvg

--
    Greg Goebel          ftp://fcext3.external.hp.com/dist/mxd/index.html
    HP MXD Marketing     http://hpislsup.lvld.hp.com (HP only)
    pctm@lvld.hp.com     http://www.geocities.com/CapeCanaveral/Launchpad/6000

Outcomes