static double counter=0;static double counter2;static double theta_D;static int flag;counter=0;counter2=400;flag=0;double Freq;theta_D = InputSignal(0,0);if(IsSampleHit(1)){counter++;}if(theta_D>=359){if(flag==0){counter2 = counter;flag = 1;}counter=0;}else{flag = 0;}Freq = 20000/counter2;OutputSignal(0, 0) = Freq;OutputSignal(0, 1) = counter;
MATLAB: Hi everyone, I am trying to write the below C code in MATLAB but am not able to get the counter running. Can anyone help me out please
counter
Best Answer