LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Subtract array

Solved!
Go to solution

Hi 

 

I have an array of elements example : 

1

2

3

4

 

I have an element example : 10 

 

My expected output is : 

 

10 - 1  = 9

9 - 2 = 6

7 - 3 = 4

4- 0 =0

 

I am confused and it would be a great help if you can give an algorithm or a VI code? 

 

Thank a lottt

 

0 Kudos
Message 1 of 11
(1,469 Views)

Your description and example makes no sense.

Where do the other numbers come from?

What is the math?

Is 10 an array element or a scalar?

Why is 9-2=6?

Why is 4-0=0?

0 Kudos
Message 2 of 11
(1,453 Views)

Sorry for the misunderstanding. 

 

ITs kind of difficult to word it correctly. Attaching is a excel file and the kind of operation I am looking for. 

 

 

Thank you once again 

0 Kudos
Message 3 of 11
(1,447 Views)

What have you tried?  What exactly is your input(s)?  What exactly do you want for your output(s)?


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 11
(1,437 Views)

Sorry for the misunderstanding. 

 

Its kind of difficult to word it correctly. Attaching is a excel file and the kind of operation I am looking for. 

 

 

Thank you once again 

0 Kudos
Message 5 of 11
(1,434 Views)

Yes, I saw your Excel file.  I understand the math, but I don't understand exactly what your inputs are and what you expect for an output.  How about attaching your VI to show what you have tried so far.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 11
(1,429 Views)

To make it even more clear 

There are two inputs: 

 

1st input is any array of elements [1 2 3 4 ]

2nd input is a reference element : 10 

My expected output is another array with the below mentioned operation.

 

my expected out is that, I need to subtract the 1st element of the array with the reference element : i.e. 10-1=9 .

 

Therefore 9 becomes the 1st element of my output array.

 

The second element of my output array is the 1st element of the output array (i.e.9) subtracted by the 2nd element of the input array(i.e.2). This result gives the 2nd element of the output array(9-2=7).. .

 

so on i need to populate the rest of the array in a similar way and final output being :[9 7 4 0]

 

I hope this would make things a bit more clear.

 

0 Kudos
Message 7 of 11
(1,423 Views)

This is the first step to my program and I am stuck here. So kind of nothing in the VI.

0 Kudos
Message 8 of 11
(1,422 Views)
Solution
Accepted by Rahul@123

Try to understand this, maybe you learn something:

 

 

altenbach_0-1614658887984.png

 

Message 9 of 11
(1,384 Views)

Thank you for the solution.

 

I'm still learning the use of shifters, feedback node all these concepts. 

Message 10 of 11
(1,339 Views)