LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Hihow to insert 2 elements into 2D array?

Hi I had a hard time figuring out how to insert 2 elements into 2D arrays. 
I tried using replace and insert array functions but it does not work right way.
I am using LV7.1. See the pic below.
 
 
How do I insert elements in that way?
 
Pls advise
Clement
0 Kudos
Message 1 of 8
(3,979 Views)
Astroboy please specify what you want?Smiley Indifferent
I mean is the data string or not? It looks like a string.
Also, you want to insert only single element or rows or columns?
----------------------------------------------------------------------------------
I have still not got what I love.....
0 Kudos
Message 2 of 8
(3,973 Views)

Hi astroboy,

i think you have to write your own function to do this. See the attached picture.
Hope it helps.

Mike

Message 3 of 8
(3,970 Views)
Well, "replace array subset" is not the right tool, because it keeps the size of the array constant. Insert into array only works for entire rows or columns.
 
You need a hybrid approach, because you want to insert elements at the beginning of column 1 while padding the remaining columns to the new lenght of column 1. This won't be efficient but there are plenty of ways to do that (here is one example with DBL arrays, should work equally well for string arrays as in your case).
 
How much flexibility do you need? Is it always at the beginning of the first column? Are the arrays huge (=is performance an issue)? Is this a rare operations or do you constantly need to do this (e.g. inside a loop).
 
In any case this seems like a rather arbitrary and somewhat silly operation. What is the practical purpose?
Message 4 of 8
(3,965 Views)
Mike, on a sidenote, here's a way to save some wires (could be significant at todays copper prices. ;):
 
 
 
 
 


Message Edited by altenbach on 04-16-2008 01:23 AM
Message 5 of 8
(3,961 Views)


altenbach wrote:
Mike, on a sidenote, here's a way to save some wires (could be significant at todays copper prices. ;):


Thanks altenbach,
i know it for 1D arrays but this was new for me. Smiley Happy
 
Mike
Message 6 of 8
(3,939 Views)
Hi Altenbach. Thanks.
It's an eye opener to me  though I have been working with Labview for 4 years!
I had forgotten that using loop can be used to spilt the 2D array. Thanks for your tip.
The reason for this is that, each column in the array represent each test. 
I wanted to insert 2 string items into the first column, before inserting every column into into one row of every multicolumn listbox. That's why.
 
MikeS81, Thanks.
 
Clement
Message 7 of 8
(3,889 Views)


MikeS81 wrote:


altenbach wrote:
Mike, on a sidenote, here's a way to save some wires (could be significant at todays copper prices. ;):


Thanks altenbach,
i know it for 1D arrays but this was new for me. Smiley Happy
 
Mike



It s new for me too. Smiley Happy

Thank you, Altenbach! Smiley Happy

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 8 of 8
(3,879 Views)