11-06-2020 02:42 PM
I can't seem to figure out after 3 hours how to append a 1d array onto a 2d array on a specified column.
I would just like to be able to insert a new value at the end of different columns but labview doesn't like you accessing a specific row column combination for some reason. Attached is one of different things I've tried to do to append a value onto an already existing column but it just makes a new column. When I do row x column -1 it just inserts it into the column before but moves the old value over into a new column, very confusing.
Solved! Go to Solution.
11-06-2020 03:24 PM
First, run your VI with some data saved into the controls and set them to be default values, save and attach that.
Second, go back and take some tutorials on arrays.
What you are doing makes no sense. For instance, if you have a 3 x 4 array, you are taking the size of that and multiplying the number of rows and columns together. So in this case, it would be 12. Then trying to Insert into Array at column 12. You can't do that because you don't have columns after #3 or 4. As soon as you have two or more rows and two or more columns, then your scheme fails.
Give an example of what you have and what you want the result to be.
11-06-2020 03:27 PM
You cannot insert a column unless it is adjacent to an existing columns. Typically, the product of the dimensions is >> that the highest column, so this will not work.
Can you explain graphically with some typical data (none of your controls contain default data so far!) what and where you want to "insert" something (note that you say "append" in the subject, which is again something else).
so if your 2D array s e.g.
1 2 3
4 5 6
6 7 8
What would be the value and size of the "element 2" 1D array and what result would you expect?
11-06-2020 03:30 PM
"I would just like to be able to insert a new value at the end of different columns"
This would just be adding a row. You can use "build array" for that.
11-06-2020 03:38 PM - edited 11-06-2020 03:40 PM
@Gregory wrote:This would just be adding a row. You can use "build array" for that.
The OP never really talked about rows. There is no way to make sense of the jumble of "different column", "specified column", "append", "insert", "replace" (in the file name), etc.
Of course anything can be inserted anywhere, it is just a matter of padding first. 😉
11-10-2020 03:31 PM
This helped me because I realized I can just pad zeros to get to the end of the column I want but you have to insert stuff into those other rows. I used build array.