04-02-2014 08:25 AM
Hello,
I have a 1-D array of numbers and I am trying to split the 1-D array and then contanenate into a new 1-D array.
I am taking three sets of data from the original 1-D array and then forming the new concatenated array with what should be a space in between.
What I am finding is that the final concatenated 1-D array is empty.
Also I think I am using the incorrect spacer between the three data sets. I'm usinga 1-D array of noughts and really what I what I want is to create 1 column of noughts.
The .vi is attached.
Thanks for helping.
04-02-2014 08:35 AM - edited 04-02-2014 08:37 AM
You are not concatenating the arrays, you are interleaving them.
Concatenating means you put array 1, followed by array 2, followed by array 3, .... in order.
Interleaving is when you go Array 1 element, 1, array 2 element 1, array 3 element 1, then array 1 element 2, array 2 element 2.
Since you have an empty array as a constant, you can't interleave anything with it since nothing is in that array.
I don't know what you mean by a "1-D array of noughts" and "1 column of noughts".
04-02-2014 08:52 AM - edited 04-02-2014 09:07 AM
OK, I see.
Yes, Interleaving is definitely not concatenating.
What I want to do is put back together the 3 data sets (which have been extracted from the original 1-D array) into a new 1-D array separeted by 1 zero. Its effectively a reverse split.
I will eventually save to a spreadsheet file and this will be done successively so the zero will become a column in the spreadsheet.
That's what I meant by column.
04-02-2014 09:19 AM - edited 04-02-2014 09:27 AM
Just trying to figure out how I can build 1-D array from three separate 1-D arrays.
I can't use build array becasue this builds an 3 -dimension array from the 3 x 1-d arrays.
04-02-2014 09:47 AM
@nevica wrote:
Just trying to figure out how I can build 1-D array from three separate 1-D arrays.
I can't use build array becasue this builds an 3 -dimension array from the 3 x 1-d arrays.
Yes, you can (And its the right function to use) Right-click the Build array select "Concatinate inputs"
Hit ctrl+h. This will bring up a help pane for any function you are hovering over. THEN READ the details by clicking the "Delails" link in the help window. You can learn an aweful lot by doing that
04-02-2014 09:50 AM
04-02-2014 09:57 AM - edited 04-02-2014 09:57 AM
<beaten to it>
04-02-2014 10:27 AM - edited 04-02-2014 10:35 AM
Thanks, your right. It can concatanate inputs. And yes, I should read the descriptions!!!
So what I have now is the three data sets concatanated but there is no space between them.
I have tried to make a zero data point as you can see from the .vi but non appears beacause it is an empty number.
I've tried to pull a zero onto the constant but it reverts back to shaded meaning it cannot be entered. Is there a way around this?
Addendum. Thinking is too complicated. I just used a zero numeric constant and that has solved it!!!
04-02-2014 10:38 AM
Well yes an empty array is empty and has no length.
Try this: Excel shoud interperate the NaN as 0 but any graph you show the concatinated array on will look a lot nicer.
04-02-2014 10:54 AM - edited 04-02-2014 10:57 AM
Solution attached!