moldynamics
Technical User
Dear forumers,
I am not an experienced programmer, so please bear with me I want to look at some data that I obtained and need to do the following, in pseudocode:
read x(k) list
do k=1 until end
if x(k+1) less than -10 !do nothing
end if
if x(k+1) greater than -10 then
x(k+2) greater than -10 and x(k+3) greater than -10
then
A=A+1
end if
LABEL A: do i=k till N
if x(i) greater than +10
then B=B+1
end if
go to A
end do
so basically, I need to look at values and check initially if the value is less than or greater than -10; if greater, I move on to check whether 2 next steps are also greater than -10, if yes, I continue and record this as A, if not, i repeat this exact step. next is to execute a "do i=k until N -k-1 (the end) to see if x(i) is greater than +10 and repeat this process.
Thanks for any suggestions
I am not an experienced programmer, so please bear with me I want to look at some data that I obtained and need to do the following, in pseudocode:
read x(k) list
do k=1 until end
if x(k+1) less than -10 !do nothing
end if
if x(k+1) greater than -10 then
x(k+2) greater than -10 and x(k+3) greater than -10
then
A=A+1
end if
LABEL A: do i=k till N
if x(i) greater than +10
then B=B+1
end if
go to A
end do
so basically, I need to look at values and check initially if the value is less than or greater than -10; if greater, I move on to check whether 2 next steps are also greater than -10, if yes, I continue and record this as A, if not, i repeat this exact step. next is to execute a "do i=k until N -k-1 (the end) to see if x(i) is greater than +10 and repeat this process.
Thanks for any suggestions