h = 20000*sin((2*pi*f*T));
len = round(2/(f*dt));
for i = 2:len
if (i<len)
dH = h(i+1)-h(i);
if (dH>0)
delta = 1;
else
delta = -1;
end
end
where, the code above is written by matlab code and i want to use it in c-script. I'm already wrote some of code lines in c-script and working properly, actually I'm stuck in dH equation.
so please advice me to write it in c-script, you can check on the matlab code in attachment
Thanks