From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
05-30-2011 02:19 PM
Hi, I need to re-order Table 1, in such way that it becomes in transformed in Table 2. Afterwards I Table 2 to be stored in an excel file:
Table 1
1,0 212
1,1 34
1,2 3
1,3 4
1,4 3
1,5 324
1,6 234
1,7 325
1,8 532
1,9 42
2,0 423
2,1 4
2,2 324
2,3 32
2,4 34
2,5 234
2,6 324
2,7 23
2,8 4
2,9 35
3,0 5
3,1 426
3,2 546
3,3 54
3,4 2
3,5 34
3,6 324
3,7 234
3,8 234
3,9 234
4,0 234
Table 2
0,0 0,1 0,2 0,3 0,4 0,5 0,6 0,7 0,8 0,9
1,0 212 34 3 4 3 324 234 325 532 42
2,0 423 4 324 32 34 234 324 23 4 35
3,0 5 426 546 54 2 34 324 234 234 234
4,0 234
In Table 2 it can be seen that in the first row are the decimal part of the values that appear in the first column of Table 1. On the other hand, the first column of Table 2 is composed of the integer part of the values that appear in the first column of Table 1
Thnak you very much.
05-30-2011 04:05 PM - edited 05-30-2011 04:06 PM
Your description seems incomplete.
Here's a simple example snipped that assumes an unlimited number of rows starting with 1.0 and does not assume that the first column is sorted.
There are many ways to do this. I assume you know how to write the final array to your desired file format.
05-30-2011 04:11 PM
Thanks Altenbach!
I will try your proposal.
05-30-2011 04:24 PM
...And the input is a nx1 array.
05-30-2011 04:36 PM
@fgarcia wrote:
- Does it always start with 1.0 or could it be something else. Could values in the first column be negative?: It always starts with 0
Well, your example data starts with 1.0, already breaking the rule. 😄
Your specification change is nothing a "+1" here or there cannot fix... 😉