01-09-2013 12:24 AM
Basically i have 1 d array which consisnts of thoudsands of numbers in it.
But i want to do the summation on every particular number pattern. is there a way to do it?
<EXAMPLE>
in example i posted is 1D array consists of 9 elements , if i join it to summation , my answer will be 45.
but what i want is i want to know the summation of every 4 values and come out in another array.
*reason i need it is bcuz i have a spreadsheet recorded the accummulated values (thousands of them) of differnet days and i want to rearrange them into total of every single day accumulated values *
01-09-2013 12:35 AM - edited 01-09-2013 12:35 AM
Try this. (Edit: The primitive used here is Delete from Array)
Good luck
01-09-2013 12:41 AM - edited 01-09-2013 12:41 AM
01-09-2013 01:05 AM - edited 01-09-2013 01:05 AM
P@Anand I tried ur way, it kind of work but the result come out is not the value. :S
01-09-2013 01:12 AM - edited 01-09-2013 01:13 AM
@mintonemin wrote:
P@Anand I tried ur way, it kind of work but the result come out is not the value. :S
How does a image of an indicator prove or disprove your statement. We don't know what the input is! That image has zero information content.
If you have code that you think does not work right, attach the VI and some typical data. Tell us what result you expect.
I would also strongly recommend my code above. It will be much more efficient. Have you tried?
01-09-2013 01:14 AM
altenbach i tried ur way and only 2 answer come out. it is supposed to be 3 answer.
01-09-2013 01:15 AM - edited 01-09-2013 01:20 AM
If your input has 9 elements, only 8 are used, because the last group is less than 4 elements. 9 is not divisible by 4 without a remainder.
If you want to round the size up to the next mutiple of four, do it, for example as follows:

(And please stop attaching useless pictures. We know how an array with two elements looks like 🐵