04-03-2011 07:42 AM
okay... I have the following case:
I have a 2 inputs which are both arrays of numeric datatypes. Both arrays can have a different number of rows, only the amount of columns is the same.
For example:
array1: [[1,2]]
array2: [[3,4],[5,6]]
output array: [[1,2,3,4],[,,5,6]]
How do i achieve this? I have now a rather complex solution and think it must be possible that it can be done easier.
04-03-2011 09:49 AM
I am not sure I understand what you want.
In LV an array cannot have columns with different numbers of rows. [,,5,6] does not represent a valid LV array row or column. LV will fill it in with the default value for the datatype, in this case 0, giving [0,0,5,6].
Please post your VI. Show the typical inputs and what you want the output to be. When you get that data on the front panel, Make Current Values Default and Save. Then post that VI.
Lynn
04-03-2011 10:45 AM - edited 04-03-2011 10:49 AM
Two simple choices: Build Array or Build Matrix. For appending rows you can simply use Build Array with concatenate inputs selected. For 2D scalars you can use Build Matrix and then have the option to append rows or columns. Ignore the red coercion dot, Array to Matrix is just a simple VI whose only purpose is to hide the dot so I tend to skip it.
I am guessing that you want the Append Cols output, if the default values of zero cause problems, well, then you are probably in for a bit of a complex solution.