LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Replace Array Subset-trouble!

Yo people, I have encountered a super-annoying problem, and the limited LabVIEW knowledge my brain holds at this moment seems insufficient for a satisfactory solution of this problem. I therefore need assistance in the form of additional LabVIEW-skill, which is what I hope to achive by post my question here!!!
 
I would like to: 1. let a forloop create three arrays
                       2. Replace portions of three columns in another 2D array with these three arrays.
 
Perhaps there is an easier approach than the one I've used?
 
This did work when I tried to do it with an array of strings:
but whats wrong when I try with DBL-arrays?
The original string-array has eight columns, but I only want to replace columns 5, 6 and 7, and the number of rows to replace=number of rows in new array,replace happens from the row specified by the wire that goes into the "index(row)". All this works fine, but in the DBL-example there is only three columns in both the new array, and the one I wish to replace elements in, but the wire appears broken Smiley Sad what is it that I've missed here?
Download All
0 Kudos
Message 1 of 7
(4,068 Views)
Hi

In your first example you have both the row and column indices wired to the replace array subset function, in your second you only have the row wired. In this case the replace array subset is expecting a 1D array but is getting a 2D array, hence the broken wire.

To fix it wire a constant to the column index. Since you are replacing all 3 columns try wiring a 0 to it.

Dave


Message Edited by DavidU on 06-25-2008 12:38 PM
0 Kudos
Message 2 of 7
(4,059 Views)

If you look carefully at your 2-D string string example, you'll notice that you have wires two indexes to the Replace Array Subset.

If you wire the bottom index (column) to your 2-D numeric array, it should be okay.

RayR



Message Edited by JoeLabView on 06-25-2008 07:40 AM
0 Kudos
Message 3 of 7
(4,058 Views)
You guys did it! Thank you very much for taking time and solving my super-annoying problem!
 
Turns out I won't ever be an awesome LabVIEW-programmer since I keep messing up, and wasting time like this all the time though Smiley Sad
0 Kudos
Message 4 of 7
(4,050 Views)

Don't be hard on yourself.

We all had to start and learn..    You'll do great!  Keep visiting this forum, as it is a fantastic place to learn.

I still learn..  it never ends.. 😉 😄

0 Kudos
Message 5 of 7
(4,037 Views)

Multi-dimentional array manipulation was one of the harder concept to get my head around. I remeber asking the local NI rep (when I was just a "G-babe") about a similar problem. He rolled his eyes and just walked away.

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 7
(4,031 Views)
LOL! 🙂
0 Kudos
Message 7 of 7
(4,001 Views)