LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create L-Shaped Array?

Solved!
Go to solution

For example, Im trying to create an array that has 1 column of 4 elements with 1 row of 4 elements hence 'L-shaped' but this doesn't seem possible unless you fill the rest of the array with 0s? Which I don't want. I tried using 'replace array subset' to insert the row of 4 elements into the column of 4 elements & vice versa, but that didn't work out. Is there any way around this?

0 Kudos
Message 1 of 7
(3,178 Views)
Solution
Accepted by topic author Nik1

Seems to be an off-shoot of this: http://forums.ni.com/t5/LabVIEW/Making-a-2D-array-triangle/m-p/1656134

 

2D arrays must be rectangular. If you need to do something like that then you'd need to use something like a cluster.

0 Kudos
Message 2 of 7
(3,176 Views)

Yeah... not quite the same, creating clusters won't work for the program I'll just think of something else then, was just wondering if there was some kind of way to have non-rectangular 2D array.

0 Kudos
Message 3 of 7
(3,162 Views)

If you can give some background on why you need an L-shape, someone can probably offer a suggestion to solve your problem.  (if smercurio's idea about clusters doesn't work)

>

"There is a God shaped vacuum in the heart of every man which cannot be filled by any created thing, but only by God, the Creator, made known through Jesus." - Blaise Pascal
0 Kudos
Message 4 of 7
(3,158 Views)

If your array is numeric, you could init the array with NaN then fill in elements as needed.  It's pretty easy to filter NaN later in your code, and some functions do it automatically.


--Using LV8.2, 8.6, 2009, 2012--
0 Kudos
Message 5 of 7
(3,137 Views)

I wish to extract portions of an array, depending on certain variables which determines the boundaries for the portion I want to extract. In some cases it might just be a rectangular section of an array that needs to be extracted, in other cases it is an L-shaped portion of the array that needs to be extracted.

0 Kudos
Message 6 of 7
(3,105 Views)

It is numeric. I think I tried something similar to this for a related section of the program, but it became a bit of a muddle removing NaNs cause then Labview would auto-resize the array (when I didnt want it to) once you filtered the NaNs from the array.

0 Kudos
Message 7 of 7
(3,104 Views)