James N Posted August 12, 2009 Report Share Posted August 12, 2009 I was working on something today and thought a "Concatenate Inputs Horizontally" would come in handy some times.. That way I could get rid of these 3 transpose array functions. I'm usually not on the cutting edge of thought... something like this hasn't been discussed before, has it? -James 2 Quote Link to comment
hooovahh Posted August 13, 2009 Report Share Posted August 13, 2009 There's always many different ways to skin a cat. So here's one option I did which doesn't use any transpose array functions (since I was under the impression that it was bad on memory usage) I just realized that this doesn't work in all use cases. If Array 2 has more rows than Array 1 then the output will not be exactly what you want, I guess the code could be modified to work properly. It's not often I need to concatenate horizontally but I wouldn't mind having it be a feature. Quote Link to comment
unicorn Posted August 13, 2009 Report Share Posted August 13, 2009 .. I'm usually not on the cutting edge of thought... something like this hasn't been discussed before, has it? -James James! Drink less beer. What's about the attached VI (LV 8.6)? I tested it for two dimensions and one case only. horizontal concenate.vi Quote Link to comment
hooovahh Posted August 17, 2009 Report Share Posted August 17, 2009 James! Drink less beer. What's about the attached VI (LV 8.6)? I tested it for two dimensions and one case only. horizontal concenate.vi Yeah that works but it has the same flaw that mine had where things don't work right if the 2nd array has more rows than the 1st, but it is an improvement over my code. Quote Link to comment
unicorn Posted August 18, 2009 Report Share Posted August 18, 2009 (edited) Yeah that works but it has the same flaw that mine had where things don't work right if the 2nd array has more rows than the 1st, but it is an improvement over my code. Right, then we need to check for this and concenate the missing lines to the first array. Or use the initial solution using transpose arrays which is applicable to 2D-arrays only Edited August 18, 2009 by unicorn Quote Link to comment
Rolf Kalbermatter Posted August 26, 2009 Report Share Posted August 26, 2009 There's always many different ways to skin a cat. So here's one option I did which doesn't use any transpose array functions (since I was under the impression that it was bad on memory usage) Transpose Array is under such circumstances usually almost a NOP. Thanks to LabVIEW having something like sub-arrays. Rolf Kalbermatter 1 Quote Link to comment
hooovahh Posted August 21, 2014 Report Share Posted August 21, 2014 Revive a 5 year old thread? Why not. Turns out there is a easier way to concatenate a 2D array of numerics horizontally using the matrix math build matrix function. There is a right click option for append columns, or append rows. http://forums.ni.com/t5/LabVIEW/Concatenate-2d-arrays/m-p/2959175#M853118 1 Quote Link to comment
GregFreeman Posted August 28, 2014 Report Share Posted August 28, 2014 (edited) Revive a 5 year old thread? Why not. Turns out there is a easier way to concatenate a 2D array of numerics horizontally using the matrix math build matrix function. There is a right click option for append columns, or append rows. http://forums.ni.com/t5/LabVIEW/Concatenate-2d-arrays/m-p/2959175#M853118 Believe it only works for numerics though. Edited August 28, 2014 by GregFreeman Quote Link to comment
hooovahh Posted August 28, 2014 Report Share Posted August 28, 2014 Believe it only works for numerics though. Yup that's what I said. Quote Link to comment
GentlemanS Posted May 16, 2019 Report Share Posted May 16, 2019 With A slight modification you can get the intended result: horizontal concenate.vi Quote Link to comment
gb119 Posted May 19, 2019 Report Share Posted May 19, 2019 But surely all of these are slower and more memory wasteful than transposing which simply twiddles the order and offsets of the pointers that are used to index the block of memory in which the array resides? Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.