Topic
selecting positive values
Page d'accueil ' Communauté ' FPScript ' sélectionner des valeurs positives
- Ce sujet contient 5 réponses, 2 participants et a été mis à jour pour la dernière fois par mac ye, le il y a 14 années et 6 mois.
-
AuteurMessages
-
09.11.2010 à 02:23 #33148mac yeParticipant
I got a problem in filtering positive values from a data set.
background:
A is a data set with pos and neg values. and I want to selet all the positive values and set all negative values to 0
so I create a data set B with same number of colums and initial value as 0I wrote a script in a function like this:
Dim i
For i=0 To 8000 Do
If A[i] < 0 Then B[i]==A[i] End End But it returns "no value" Would you please give me an example for this?09.11.2010 à 02:23 #33153mac yeParticipantI got a problem in filtering positive values from a data set.
background:
A is a data set with pos and neg values. and I want to selet all the positive values and set all negative values to 0
so I create a data set B with same number of colums and initial value as 0I wrote a script in a function like this:
Dim i
For i=0 To 8000 Do
If A[i] < 0 Then
B[i]==A[i]
End
EndBut it returns "no value"
Would you please give me an example for this?09.11.2010 à 17:39 #33149Bernhard KantzParticipantYou have to use = instead of ==.
But it’s better and faster to use the [b]ValuesBelow[/b]-function and the index operator.Example:
[code]
Dim B = A
B[ValuesBelowLevel(A, 0, EVENT_INDEX)] = 0
[/code]
support@weisang.com09.11.2010 à 18:57 #33150mac yeParticipanthello, thank you for your reply!
when I use the valusebelow func, it replies:
index assignment to signals, signal serials.. are not allowed. assign the components seperately.
So do you have any further recommendation?
Thank you!
09.11.2010 à 23:58 #33151Bernhard KantzParticipant10.11.2010 à 02:31 #33152mac yeParticipantThank you! It works!
-
AuteurMessages
- Vous devez être connecté pour répondre à ce sujet.