The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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?


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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.