Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Calculating remainder (modulus) in C Mex S Function
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
user Butt

Posts: 32
Registered: 10/8/09
Calculating remainder (modulus) in C Mex S Function
Posted: Feb 21, 2013 8:04 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

I'm having problem in converting data type within C Mex S function.
I would like to calculate the modulus of a real_T data type.
if I calculate remainder using C language format i.e., (input%5) in C Mex S function, then I get errors in compiling mex function. Can anyone of you help me how to calculate the remainder operator in the C-mex S Function?

My code looks like this

real_T data;
real_T Sample_Length = 120;
int_T counter;
counter = 0;
if (data%Sample_Length==0)
{
counter= counter +1;
}

Or is there any other way I can realize this modulus operator?

Saif



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.