05-20-2014 05:07 AM
05-20-2014 07:17 AM
You need to give more details than that. What elements are we multiplying? What should the output array be? It would help if you supplied a good example.
05-20-2014 07:50 AM
Example:
N consecutive numbers where N=100
input array :12345.......100
output array: (1*2)(2*3)(3*4)...
that is, 2 6 12 ...
05-20-2014 08:19 AM - edited 05-21-2014 02:57 PM
So the output array should be one shorter?
Take " array subset" with index 1 and multiply the resulting array with the original array.
No loop needed. Try it!
05-20-2014 11:57 PM
Yes,
What is the input to the subarray and how do you create an original array of N consecutive elements?
I'm new to labview. Can you please show it here?
05-21-2014 06:58 AM
Altenbach just gave the you the full answer in two functions (very impressive). Look in the Array palette for Array Subset. This is how you can create a subarray. What was suggested to you was to wire in a 1 to the index and leave the length unwired. The result will then be (based on your example) 2,3,4,5...100. Multiply this array with your original array and you will have the result you are looking for.
05-21-2014 09:42 AM
The input to the subarray is the original array. Just branch the wire.
To create an array of consecutive integers 1..100, use a FOR loop. Wire 100 to N (right-click...create constant).
Place a "+1" (increment) inside the FOR loop and wire its input to the iteration terminal. wire its output to the right loop boundary. The output of the loop will be the desired array that you can manipulate as described (right-click...create indicator" to see it).
05-21-2014 02:54 PM - edited 05-21-2014 02:55 PM
Here's how the final code shouold look like...
I hope it will give you some initial clues how easy and powerful LabVIEW is and encourage you to learn more! Good luck!
Try to wire it up yourself and verify the output for correctness. 😉
05-21-2014 03:30 PM
If this is homework you should also be able to do it by indexing in a loop and/or using shift registers in a loop. Altenbach's method is elegant and efficient but would probably make a teacher suspicious if a beginner student handed it in.