From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

create list of numbers, each digit repeats x times

Solved!
Go to solution

Hi,

 

I have taken some time dependent measurements and am trying to create a 3D plot of them, but I do not actually have an array of time data. All I have is a 2D array with 2 columns, each with 20000+ elements. These two columns should correspond to my X and Z values in the 3D, with Y being time. It would be simple to create a list of, say, numbers 1-100 and append that to my existing 2D array, but I cannot do that. I have 2048 pairs of X,Z data for a single time, t, so I need to create a list 1-100 where each number is repeated 2048 times before moving onto the next, in order for my X,Y,Z matrix to work.

 

Any ideas on how to create this list?

0 Kudos
Message 1 of 5
(3,559 Views)

Perhaps passing a list with numbers 1-100 into a for loop may be a good start. I am not sure.

0 Kudos
Message 2 of 5
(3,550 Views)

Is every number repeated 2048 times?

 

From my understanding you have a 2048 over 100 measurement times and are looking to build a 3D array out of the results.

You could consider splitting your single large array into however many Y elements you have (in your example 100) so that each page of your array contains the information for a Y value denoted by the page of the array?

 

From there the problem does become working it back to the 3D graph format. Do you have an example of how you are planning on formatting this graph?

0 Kudos
Message 3 of 5
(3,497 Views)
Solution
Accepted by topic author Miggy26

Would something like this be what you are looking to do?

 

X Repeat Y.png

 

If your list of numbers to be repeated isn't a simple 1-100 just create that array and index that into the for loop to use as your initialize element.

Matt J | National Instruments | CLA
Message 4 of 5
(3,457 Views)

Jacobson,

 

Thank you very much for your input, they is just what I needed. I thought something with using the loop iteration count to do it but was not familiar with the initialize array node. Had to use build array (set to concatenate inputs) due to my older version of LabView, but you sent me in the right direction. Thanks!

0 Kudos
Message 5 of 5
(3,371 Views)