LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Arrays

Hi
 
I am having a doubt in arrays,
 
I got a column array around 200 index,of this i got some negative values.for ex: from 0 to 20 the values are positive ,from 21 to 40 the values are positive,it continues likewise positive and negative.
 
For this i have to change the negative sign and add some common value to each of the negative values. so that i can get all positive values in arrays
 
thanks
0 Kudos
Message 1 of 15
(4,036 Views)
If I understand you correctly, you could just use the absolute value node on your array (see attached).  It I dont understand you correctly please let me know so that I can help.

Good Luck
0 Kudos
Message 2 of 15
(4,032 Views)
You're not giving us much information to help you.  Take a look at this to get some simple ideas:
LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 3 of 15
(4,025 Views)
You beat me to the punch.  But mine has graphs!  Smiley Tongue
LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 4 of 15
(4,021 Views)
What is the old saying, "A graph in time saves nine..."
0 Kudos
Message 5 of 15
(4,016 Views)

Smiley Very Happy

Now that I think about it, I hope the original question wasn't an April Fool's joke!

LabVIEW Pro Dev & Measurement Studio Pro (VS Pro) 2019
0 Kudos
Message 6 of 15
(4,010 Views)

Thanks evryone, no its not April fool joke. Its a part of my program

I will check it and let u all know the result

 

thanks

0 Kudos
Message 7 of 15
(4,007 Views)
I think easiest would be to subtract the ArrayMin. This will change the offset so the lowest point of the array is zero. At the same time it is not changing the shape of the curve or introduce discontinuities.

Modify as needed. (You could e.g. add a case so it only subtracts if the ArrayMin is negative.)


Message Edited by altenbach on 04-01-2008 05:54 PM
Message 8 of 15
(3,989 Views)
Hi
Thanks for your codes
Let us consider the code AbsValArray.vi, initially we have the sine wave, with  the absolute block all the negative values are changed to positive values but i need those values to be linearly increase with time(to compensate the negative phase angle we can add 90 deg)
 
0 Kudos
Message 9 of 15
(3,943 Views)


vrk wrote:
... but i need those values to be linearly increase with time(to compensate the negative phase angle we can add 90 deg)

Sorry, I don't understand what you are saying. What "values"? Where is a "negative phase angle"? What exactly "increases linearly"?
 
Using the "absolute value" you are highly distorting the signal, for example if you would do a Fourier transform before and after, you would see that taking the absolute value doubles the frequency, adds additional harmonics, and (of course) adds a DC component. It seems silly to do all that to a signal unless you're not really interested in the data at all. What good is irreversibly mutilating the data? If this is acceptable, you might as well multiply your array with zero to make sure nothing is negative. 😮 same difference! 😄
Why don't you show us some of your real data and tell us what you want. (e.g. before>>after).
0 Kudos
Message 10 of 15
(3,908 Views)