Multiply 3D array elements by constant

I consider myself a beginner at LabVIEW.  With that said, I have a 3D array (x,y,z) where x and y both range from 0-400 and z ranges from 0-13.  I want to multiply all of the x's and y's under each z, by a different constant.  For example, x=0-400, y=0-400 and z=0, I want to multiply both x and y by 0.4.  Then for x=0-400, y=0-400 and z=1 I want to multiply x and y by 0.43 (random cosntant), and so on.
How can I do this?
Thanks in advance!

I actually asked the wrong question.  If this thread needs to be deleted and I need to start another one, just let me know.
This is what I'm trying to do.  I have a 3D array (x,y,z) where x and y are pixel locations of an image (rows and columns ranging from 0-400) and z is wavelength (ranging from 0-13).  For each combination of x,y and z there is a value.  I want to hold z constant at 0 (z=0) and multiply every value at every pixel location by a constant.
For example x=0-400, y=0-400 and z=0.  I want to multiply the value at every combination of x and y by a constant while holding z at 0. Then move onto z=1 and multiply every combination of x and y by a different constant.
I attached an image of an indicator from the 3D array below.  The three white boxes are the x y and z and the fourth grey box is the value I want to change for each combination of x and y for z=0-13.

Similar Messages

  • Is it possible to multiply the content of an array by a constant numeric.

    Hi,
    I am using Universal library to read a voltage from a DAQ device, and it seems the reading function is putting it into an 1-D array then into a graph.
    I need to get this voltage and multiply by a number and could not do that as it is in array format.
    How would I be able to multiply the array content by a constant numeric?
    Thanks
    Solved!
    Go to Solution.

    Hi,
    Thanks for the reply, did not work, I have attached an image illustrating it.

  • Best way to iniitialize a queue with array elements

    Hi Guys
    I'm looking for a bit of performance optimization..  
    I'm developing a noise measurement application using LV8.6 and Win Xp /Win 7.
    To put it very simple I have a loop that samples, and a loop that does the math. data is shipped in a queue, producer / consumer style.
    So far so good.. Question is - is there a specific and more optimized way to declare this queue?
    I was wondering if declaring the queue with an initialized array element of a fixed size (the number of samples pr. read from the sound card will be known at runtime) would produce a queue that would be less heavy on dynamic allocation of memory compared to a queue obtained using a simple control no values.
    I've attached a screen dump to maybe make the question more obvious..
    I've been thru the "clear as mud" thread, as recommended in other threads that covers this topic - but i gets very high tech, and I kind of lost my way in it.. So looking for a more simple "you should use solution #x, because..."
    Thank you in advance. 
    Solved!
    Go to Solution.

    I believe (but am not sure) RT FIFOs will allocate this memory for you ahead of time. But, remember they are not deterministic on windows. You need to wire an array constant of the correct size into the FIFO read function also to avoid memory allocation, which is easy to overlook. It's worth looking into, if nothing else, assuming you have RT functions available. WIth this method, the queue size needs to be set, and you run the risk of overflowing and losing elements if not handled correctly. 
    Just throwing other options out there.
    CLA, LabVIEW Versions 2010-2013

  • Accessing custom device FIFO array element by name

    Hi,
    Some of my custom devices have a large number if I/Os. Because the FIFOs are arrays, my custom device RT driver VI has been referencing them by indexing the arrays. Is there a recommended method to reference FIFO I/Os by name, and preferably the same name as the channel names that are created by the initialization VI? Referencing array elements by index can get very confusing and not very flexible if I need to add or remove custom device I/Os. Thanks.

    You could use an enum diagram constant to wire to the index terminal of index array. Make the item name correspond to the element name.
    LabVIEW Champion . Do more with less code and in less time .

  • How do I programmat​ically modify array element sizes?

    Hi All,
    I have a quick question about modifying the size of array elements. Hopefully someone can help, because I am at a dead end!
    I am logging some intensities from a Fibre Array using a camera. For calibration of the system, I acquire an image from the camera, click points on the image to divide it into areas of interest. I overlay my image with a grid showing the regions of interst - for example a 4x6 array. I then have to select the fibres - or ROIs - I want to log from.
    I have a cluster type-def ( a number and a boolean) to specify the fibre number and to turn logging from that fibre on/off. I overlay an (transparent) array of this typedef over my image to correspond with the regions of interest. So here's my problem - I want to modify the dimensions of the array so each control matches my ROI. I can resize the elements by rightclicking on the elements on the frontpanel, but can't find a way to do it programmatically. The Array Property Node>>Array Element>>Bounds won't 'change to write'...thats the first thing I tried.
    Its really only important that the elements align with my ROIs - so programmatically adding in gaps/spacings would also work for me...but again I can't figure out how to do this! I've attached a screenshot of part of my image with array overlaid to show you all exactly what my problem is.
    Thanks in advance for you help,
    Dave
    PS I am running Labview 8.6 without the vision add on.
    Solved!
    Go to Solution.
    Attachments:
    Array_Overlay.png ‏419 KB

    Here's my cheat (and cheap?) way If you want to get fancy and center the numeric and boolean indicators, you could add spacers on the north and west sides, too.
    Attachments:
    ClusterSpacer.vi ‏13 KB

  • How can I display all results of a array element in a TS2.0 NumericArrayMeasurement in a single report line?

    TestStand2.0 generates for each result property ( data, limits, status...) of each array element in a NumericArrayTest an extra line in the test report.
    How can I change this to display all result properties of one array element in a single line?
    How can I reduce the spaces between the property name and its value in the report?
    How can I delete the message: "Measurement[x]" and display only the Measurement Alias (named in the Edit Limits menu)?
    This means I like to change my report from:
    Measurement[0] (ADC1):
    Data: 5000
    Status: Passed
    Measurement[1] (AD
    C2):
    To:
    ADC1: Data: 5000 Status: Passed
    ADC2: ...

    Hi,
    What you can do, is use the Override Callbacks for Modify the Report that is Generated.
    Also you can also change the report sequence 'reportgen_txt.seq' to achieve the desired affect. If you go for modifying the report sequence then copy this to the User folder and then make your changes.
    In the Resources Library you can find simple examples were the report has been modified by either using the Override Callbacks or by modifying the actual sequence.
    One other item in the Report Options you will have to set the 'Select a Report Generator for Producing the Report Body' control to use the Sequence instead of the DLL.
    Hope this helps
    Ray Farmer
    Regards
    Ray Farmer

  • How to use XSLT for mapping feild names one by one to array element

    I have a XSLT case to map all the attributes feild name(not value) which has no child to the target, which is array loop.
    I give an sample below.
    source:
    <Items xmlns="http://www.example.org/sample">
    <SourceSystem>SourceSystem2573</SourceSystem>
    <TimeStamp>2010-01-17T20:54:08.234</TimeStamp>
    <Item>
    <ID>2574</ID>
    <Type>2575</Type>
    <Name>2576</Name>
    </Item>
    </Items>
    source XSD like:
         <element name="Items" type="tns:ItemsType"></element>
         <complexType name="ItemsType">
              <sequence>
                   <element name="SourceSystem" type="string" maxOccurs="1"
                        minOccurs="1">
                   </element>
                   <element name="TimeStamp" type="dateTime" maxOccurs="1"
                        minOccurs="1">
                   </element>
                   <element name="Item" type="tns:ItemType"
                        maxOccurs="unbounded" minOccurs="1">
                   </element>
    </sequence>
         </complexType>
    <complexType name="ItemType">
              <sequence>
                   <element name="ID" type="string" maxOccurs="1"
                        minOccurs="1">
                   </element>
                   <element name="Type" type="string" maxOccurs="1"
                        minOccurs="1">
                   </element>
    <element name="Name" type="string" maxOccurs="1"
                        minOccurs="1">
                   </element>
    </sequence>
         </complexType>
    target need to be like:
    <ns1:AttributesCollection>
    <ns1:Attributes>
    <ns1:fieldname>SourceSystem</ns1:fieldname>
    </ns1:Attributes>
    <ns1:Attributes>
    <ns1:fieldname>TimeStamp</ns1:fieldname>
    </ns1:Attributes>
    <ns1:Attributes>
    <ns1:fieldname>ID</ns1:fieldname>
    </ns1:Attributes>
    <ns1:Attributes>
    <ns1:fieldname>Type</ns1:fieldname>
    </ns1:Attributes>
    <ns1:Attributes>
    <ns1:fieldname>Name</ns1:fieldname>
    </ns1:Attributes>
    </ns1:AttributesCollection>
    target XSD:
    <xs:element name="AttributesCollection" type="AttributesCollection"/>
    <xs:complexType name="AttributesCollection">
    <xs:sequence>
    <xs:element name="Attributes" type="Attributes" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
    </xs:complexType>
    <xs:complexType name="Attributes">
    <xs:sequence>
    <xs:element name="fieldname" minOccurs="0">
    <xs:simpleType>
    <xs:restriction base="xs:string">
    <xs:maxLength value="100"/>
    </xs:restriction>
    </xs:simpleType>
    </xs:element>
    </xs:sequence>
    </xs:complexType>
    I know we can use local-name() to get the tag/field name,
    but I have not idea how to get these leaf field names one by one and then mapping to every array elements.
    I tried whole day but no successful
    Does anyone have some idea?
    Thanks very much!
    Keith
    Edited by: user1065212 on 17-Jan-2010 22:50
    Edited by: user1065212 on 17-Jan-2010 22:53
    Edited by: user1065212 on 17-Jan-2010 22:59

    can you paste source xsd and the correct xml output, the current one isn't really valid
    <ID>2574</TotalNumOfItems>

  • Allocate array elements one at a time?

    Is there a way to allocate array elements one at a time?
    The following code will crash because the minimumLogIndices array is not allocated.
    // get all indices where cArray[i] > minimumLog
    int[] minimumLogIndices = null;
    for (int i=0; i < columns; i++)
      if ((cArray[i] > minimumLog))
        minimumLogIndices[i] = i;
    }I would like a statement like:
    minimumLogIndices[i] = new(i);but this is not allowed, of course.
    If I use ArrayList, then the elements can be added one at a time, but I cannot use int.
    null

    int[] minimumLogIndices = new int[columns];As described here:
    http://java.sun.com/docs/books/tutorial/java/nutsandbolts/arrays.html
    [Edit] The array will, however, have "holes" in it when cArray[i] <= minimumLog, but that's inevitable if you are using an array.

  • How to set the value of an array element (not the complete array) by using a reference?

    My situation is that I have an array of clusters on the front panel. Each element is used for a particular test setup, so if the array size is three, it means we have three identical test setups that can be used. The cluster contains two string controls and a button: 'device ID' string, 'start' button and 'status' string.
    In order to keep the diagrams simple, I would like to use a reference to the array as input into a subvi. This subvi will then modify a particular element in the array (i.e. set the 'status' string).
    The first problem I encounter is that I can not select an array element to write to by using the reference. I have tried setting the 'Selection s
    tart[]' and 'Selection size[]' properties and then querying the 'Array element' to get the proper element.
    If I do this, the VI always seems to write to the element which the user has selected (i.e. the element that contains the cursor) instead of the one I am trying to select. I also have not found any other possible use for the 'Selection' properties, so I wonder if I am doing something wrong.
    Of course I can use the 'value' property to get all elements, and then use the replace array element with an index value, but this defeats the purpose of leaving all other elements untouched.
    I had hoped to use this method specifically to avoid overwriting other array elements (such as happens with the replace array element) because the user might be modifying the second array element while I want to modify the first.
    My current solution is to split the array into two arrays: one control and one indicator (I guess that's really how it should be done ;-) but I'd still like to know ho
    w to change a single element in an array without affecting the others by using a reference in case I can use it elsewhere.

    > My situation is that I have an array of clusters on the front panel.
    > Each element is used for a particular test setup, so if the array size
    > is three, it means we have three identical test setups that can be
    > used. The cluster contains two string controls and a button: 'device
    > ID' string, 'start' button and 'status' string.
    >
    > In order to keep the diagrams simple, I would like to use a reference
    > to the array as input into a subvi. This subvi will then modify a
    > particular element in the array (i.e. set the 'status' string).
    >
    It isn't possible to get a reference to a particular element within an
    array. There is only one reference to the one control that represents
    all elements in the array.
    While it may seem better to use references to update
    an element within
    an array, it shouldn't really be necessary, and it can also lead to
    race conditions. If you write to an element that has the
    possibility of the user changing, whether you write with a local, a
    reference, or any other means, there is a race condition between the
    diagram and the user. LV will help with this to a certain extent,
    especially for controls that take awhile to edit like ones that use
    the keyboard. In these cases, if the user has already started entering
    text, it will not be overwritten by the new value unless the key focus
    is taken away from the control first. It is similar when moving a slider
    or other value changes using the mouse. LV will write to the other values,
    but will not rip the slider out of the user's hand.
    To completely avoid race conditions, you can split the array into user
    fields and indicators that are located underneath them. Or, if some
    controls act as both, you can do like Excel. You don't directly type
    into the cell. You choose w
    hich cell to edit, but you modify another
    location. When the edit is completed, it is incorporated into the
    display so that it is never lost.
    Greg McKaskle

  • Problem in assigning value to an array element

    hi all
    in the following prog i am not able to assign the value to the array element
    i am not getting why it is giving me error
    //my program is as follows
    public class ArrayTest
         static int [] intArray = new int[5];
         static int [] intArray1 = new int[1];
         intArray1[0] = 5; // this line gives error
         static char [] charArray = new char[5];
         public static void main(String args[])
              System.out.println(charArray);
              intArray1 = intArray;
    }thanx in advance as usual

    The problem is that you try to execute code outside a method. This can be only done in form of a variable declaration or as a static initilization block which will be executed once when the class is loaded:public class ArrayTest
         static int [] intArray = new int[5];
         static int [] intArray1 = new int[1];
         static char [] charArray = new char[5];
         static {
              intArray[0] = 5;
         public static void main(String args[])
              System.out.println(charArray);
              intArray1 = intArray;
    }

  • A lot of time to multiply two arrays

    Hello!
    I want to multiply two arrays. The size of the two arrays is 1568x1568. I use to do it a AxB.vi block....but it spends a huge time, almost 17 seconds, when a operation like this have to be done it less than in a second.
    I 've attached an example of the multiplication of two arrays with this size, you have to wait 16 seconds to obatin the result.
    Someone know how i can do this multiplication as far as possible?I have to use another block.....for example....formula node and make iterations (or in this way you spend the same time?)
    Thank you very much
    Larson

    Nomis wrote:
    On my system (P4, 2.6GHz, 1GB Ram Win2K), the example runs in 19 seconds in LV7.0 but in 7.1 it runs in 300mS!
    No idea why - perhaps the AxB function was rewritten for 7.1
    Yes the matrix operations got a big makeover in LabVIEW 7.1 and are MUCH faster as demonstrated here.
    On my 1.6GHz PentiumM laptop, the difference is not that big, but still about 10x.
    LabVIEW 7.0: 3700ms
    LabVIEW 7.1: 360ms
    Time to upgrade!
    LabVIEW Champion . Do more with less code and in less time .

  • How to change the color of Numeric array elements (seperatel​y) programmat​ically using property node??

    For example, i have 3 numeric controls, controlling 3 numeric array elements (Numeric control is connected directly to indicator). Then if i change value in numeric control 1, then the array element No.1 of numeric array should turn red when value exceeds 5. Similarly when i change num control 2 then element 2 of array should turns red when value in num control 1 exceeds 10. Similarly for 3rd element. In other words, i want to control the property of array elements individually through seperate numeric control.
    I have done it for single numeric indicator.i.e. when i change numeric control's values then a single numeric indicator changes values and color (Numeric text BG property) but with array, the color of whole array changes but i want to change color of singles element of array.
    Please help thanks.  
    Solved!
    Go to Solution.

    ...or replace the numerics with clusters that have a numeric and a color box. make the background of the nmeric transparent and slide the color box behind the numeric. Use the color box to control the background color.
    Other alternatives would use a cluster instead of the array or if your req's are really weird "roll-your-own" with a Picture control.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How to set an array element in an object type of array??

    Hi,
    I have set attribute as follow:
    Color[] colors;
    Color[] colors = new Color[20];
    colors[0] = "Red";
    colors[1] = "blue";I can't compile this code. It said:
    "Incompatible type -found java.lang.String but expected Colors
    Could you tell me how to set an array elements when the array type is an object?

    in your case, the array shouldn't be Color[] but String[] since you re intending to put strings into it
    by the way, you could also use a hashmap to map a string to a color:
    HashMap<String, Color> hm = new HashMap<String, Color>();
    hm.put("Red", Color.RED);
    hm.put("Blue", Color.BLUE);
    etc.

  • "In initializer for 'mxmlContent', type Object is not assignable to target Array element type..."

    Hi all,
    So I've have built an application on flash builder 4.5 using Christophe Coenraets' tutorial "Building an EmployeeDirectory" (http://www.adobe.com/devnet/flex/articles/employee-directory-android-flex.html#articlecont entAdobe_numberedheader).
    I'm getting this error message "In initializer for 'mxmlContent', type Object is not assignable to target Array element type mx.core.IVisualElement." and then the debugger highlights my code this line of my code "</s:List>" in my EmployeeDetails.mxml file. This started after I coded Part 5, Step 2 "Integrating with the Device Capabilities: Triggering the Actions".   The rest of the code debugged fine.
    I think it relates to Christophe's note "Note: Make sure you import spark.events.IndexChangeEvent (and not mx.events.IndexChangedEvent) for this code to compile.".  I don't know where to place this
    " import spark.events.IndexChangeEvent;" line of code. 
    Any help?  Tks in advance..
    Any help would be greatly appreciated.  Thanks

    You have a DataGrid directly inside a State element. Perhaps wrap it in an AddChild element?
    More information on using states can be found here:
    http://livedocs.adobe.com/flex/3/html/help.html?content=using_states_1.html

  • Read part of an array element

    Hello All.
    As indicated in the title, I am trying to read part of an array element.
    What I'm doing is reading values from a LeCroy scope using a "write" than "read" I have returned the read values into an array but the issue is the scope returns a value "1, 52.33E-3"
    I simply want the element to be 52.33 that way I can use that for other calculations.
    For example my array is.
    "1, 34.334E-3"
    "1, 53.343E-3"
    "1, 143.232E-"
    And I want it to be
    34.334
    53.343
    143.232
    Thanks!
    Solved!
    Go to Solution.

    Another option is to use Spreadsheet String to Array and use the comma as the delimiter.  It can actually change your string into an array of numbers.  Then you just index out the number you want.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

Maybe you are looking for