I am trying to perform a modulo operation in MATLAB, and I'm not sure how to convert the input variable to the correct data type for the modulo operation to complete.
Here is what I have:
sequence = 0;
....
sequence = sequence + 1;
if (modp(sequence, 3) == 0)
....
In C-ish, I'm looking to perform if (sequence % 3 == 0)
.
MATLAB complains that there is no modp
operation for a double, and that I must use an int. However, the documentation doesn't say which integer format I need to use (i.e., int8
, int64
, et cetera) and none of those integer formats work.
What am I doing wrong?