# LabVIEW

cancel
Showing results for
Did you mean:

Solved!
Go to solution

## Subtract array

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

Message 1 of 11
(233 Views)

## Re: Subtract array

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?

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 2 of 11
(217 Views)

## Re: Subtract array

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

Message 3 of 11
(211 Views)

## Re: Subtract array

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

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
Message 4 of 11
(201 Views)

## Re: Subtract array

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

Message 5 of 11
(198 Views)

## Re: Subtract array

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.

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
Message 6 of 11
(193 Views)

## Re: Subtract array

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.

Message 7 of 11
(187 Views)

## Re: Subtract array

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

Message 8 of 11
(186 Views)
Solution
Accepted by Rahul@123

## Re: Subtract array

Try to understand this, maybe you learn something:

LabVIEW Champion. It all comes together in GCentral
What does "Engineering Redefined" mean??
Message 9 of 11
(148 Views)

## Re: Subtract array

Thank you for the solution.

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

Message 10 of 11
(103 Views)