LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subarray elements addition

Your boss?

You mean he just wanted to see if you could implement something without any actual reason? 

😮

0 Kudos
Message 11 of 16
(855 Views)
Not at all. he want me to be thorough with programming concepts & gave me some sample codes to work out.
0 Kudos
Message 12 of 16
(852 Views)
Or was it a test?......Smiley Surprised
0 Kudos
Message 13 of 16
(846 Views)
 

Sithu wrote:
Thank you so much. i have one more doubt regarding array addition. I want to add the consecutive array elements & this process must be controlled by an add button. i.e. say, array given is {0,1,2,3,4,5}. I want the addition as follows : {0+1}, {1+2}, {2+3}, {3+4}, {4+5}.
Well, this makes little sense. Apparently, you use the curly braces to denote "array". From your notes, it seems you want to end up with 5 arrays with one element each.
Instead, my solution will output a shorter array with 5 elements {0+1, 1+2, 2+3, 3+4, 4+5}. Is this what you want instead?


Sithu wrote:
The addition must be done iff add button is enabled

I assume when the start button is pressed. "Enabled" is a property that determines if the button can be operated at all by the user.
It has nothing to do directly with any user action.


Sithu wrote:
thanks Mike... Ill explain clearly.
1. the user can input an array of any dimension.
2.the addition must be performed as per the logic you said.
3.the task must be performed when the user presses the add buttton.
4. when the button is released the task is stopped.
5. addition process is resumed when the user again presses add button.(result till the previous addition is stored in a buffer.)

(1) You probably mean "of any size", not "dimension". If you want the user to be able to enter 1D, 2D, 3D, etc arrays at will, it would require quite a bit more programming.
(4) The task is done when the addition is complete. Judging from requirement (5), the VI should continue to run.

Attached is a quick attempt to get you started. You need to modify it according to your exact requirements.
Message 14 of 16
(830 Views)


altenbach wrote:
 
(1) You probably mean "of any size", not "dimension". If you want the user to be able to enter 1D, 2D, 3D, etc arrays at will, it would require quite a bit more programming.

I was wondering about handling "any dimensions"..  😉  I was looking forward to reading people's solution..
But you're probably right, Altenbach.. it is probably any size...  which makes this a little bit easier.
Message 15 of 16
(822 Views)


JoeLabView wrote:

it is probably any size...  which makes this a little bit easier.

The definition of "adjacent elements" is also a bit more tricky for multidimensional arrays. 😄
Message 16 of 16
(820 Views)