See this newsgroup thread where Bruno Luong gives advice on how to do this calculation without using the symbolic toolbox: Answer from James Tursa on mathworks.com
๐ŸŒ
MathWorks
mathworks.com โ€บ fixed-point designer โ€บ data type exploration โ€บ fixed-point specification โ€บ fixed-point specification in matlab โ€บ fixed-point math functions
mod - Modulus after division for fi objects - MATLAB
m = mod(x,y) returns the modulus after division of x by y, where x is the dividend and y is the divisor. This function is often called the modulo operation, which can be expressed as m = x - floor(x./y).*y. For fixed-point or integer input arguments, the output data type is the aggregate type ...
๐ŸŒ
MathWorks
mathworks.com โ€บ symbolic math toolbox โ€บ mathematics โ€บ number theory
mod - Symbolic modulus after division - MATLAB
For vectors and matrices, mod finds the modulus after division element-wise. When both arguments are nonscalar, they must have the same size. If one argument is a scalar, the mod function expands the scalar input into an array of the same size as the other input.
Discussions

Mod or Modulus operator in MATLAB
Mod or Modulus operator in MATLAB. Learn more about mod operator More on mathworks.com
๐ŸŒ mathworks.com
2
2
February 2, 2016
how to calculate modulus in matlab ?
how to calculate modulus in matlab ?. Learn more about modulus More on mathworks.com
๐ŸŒ mathworks.com
4
0
May 15, 2013
use of modulus in matlab
use of modulus in matlab. Learn more about absolute non negative difference More on mathworks.com
๐ŸŒ mathworks.com
1
0
November 1, 2019
What is modulo in simulink?
I am a matlab beginner. Recently, I had to use simulink because of my thesis study, but I can't find it, so I'm leaving a question. No modulo found for this illustration. I need a modulo without i... More on mathworks.com
๐ŸŒ mathworks.com
1
0
January 25, 2023
๐ŸŒ
MathWorks
mathworks.com โ€บ matlab โ€บ mathematics โ€บ elementary math โ€บ arithmetic operations
mod - Remainder after division (modulo operation) - MATLAB
Find the remainder after division by a negative divisor for a set of integers including both positive and negative values. Note that nonzero results are always negative if the divisor is negative. ... Find the remainder after division for several angles using a modulus of 2*pi.
๐ŸŒ
MathWorks
mathworks.com โ€บ matlabcentral โ€บ answers โ€บ 266180-mod-or-modulus-operator-in-matlab
Mod or Modulus operator in MATLAB - MATLAB Answers - MATLAB Central
February 2, 2016 - I want to perform a mod operation on a number. ||10|| = 10 |||-10| = 10 Basically it returns the positive value of the input. All I could find is the sign() operator which returns 1,-1 or...
๐ŸŒ
Duke
pundit.pratt.duke.edu โ€บ wiki โ€บ MATLAB:Mod
MATLAB:Mod - PrattWiki
September 27, 2017 - MATLAB's mod command returns the remainder after division. It is also called the modulo operation (thus, mod). ... Among other things, mod is great for determining if a given integer is odd or even.
๐ŸŒ
MathWorks
mathworks.com โ€บ matlabcentral โ€บ answers โ€บ 503407-use-of-modulus-in-matlab
use of modulus in matlab - MATLAB Answers - MATLAB Central
November 1, 2019 - hello, i am trying two build a code in which i am using a formula which has difference between two quantities , but sometimes the difference between two can lead to a negative integer and i want to make it positive always as the output (like a modulus functon which when used returns non negative integres) ... Patel - perhaps you could use abs. ... Sign in to comment. Sign in to answer this question. ... Please refer to the matlab documentation in your version of the software and search for: "abs".
Find elsewhere
๐ŸŒ
MathWorks
mathworks.com โ€บ matlabcentral โ€บ answers โ€บ 1900495-what-is-modulo-in-simulink
What is modulo in simulink? - MATLAB Answers - MATLAB Central
January 25, 2023 - You can use a constant block having the value of N instead of the Modulo-N block, and then use a MATLAB Function block to perform the Modulo N operations as desired.
๐ŸŒ
MathWorks
mathworks.com โ€บ symbolic math toolbox โ€บ mathematics โ€บ mathematical functions
abs - Symbolic absolute value (complex modulus or magnitude) - MATLAB
abs(z) returns the absolute value (or complex modulus) of z. Because symbolic variables are assumed to be complex by default, abs returns the complex modulus (magnitude) by default.
๐ŸŒ
MathWorks
mathworks.com โ€บ matlabcentral โ€บ answers โ€บ 146684-how-can-i-perform-modulus-operation-mod
How can I perform modulus operation (mod)? - MATLAB Answers - MATLAB Central
March 21, 2014 - 01, 0001, 00000001, 0000000000000001 (logical, signed & unsigned 8, 16, 32, & 64 bit integers) 000000000000F03F (double) and 0000083F (single). ... https://www.mathworks.com/matlabcentral/answers/146684-how-can-i-perform-modulus-operation-mod#comment_229988
๐ŸŒ
MathWorks
mathworks.com โ€บ fixed-point designer โ€บ embedded implementation โ€บ fixed-point math operations in matlab and simulink
Modulo by Constant - Perform modulo operation with a constant denominator - Simulink
Divisor to use for the modulus operation, specified as a positive, real-valued, finite scalar, vector, matrix, or multidimensional array. ... Slope-bias representation is not supported for fixed-point data types. ... The Modulo by Constant block now supports vector and matrix inputs. The Modulo by Consant block is supported for use inside a For Each Subsystem block. ... Run the command by entering it in the MATLAB ...
๐ŸŒ
MathWorks
mathworks.com โ€บ fixed-point designer โ€บ embedded implementation โ€บ fixed-point math operations in matlab and simulink
Modulo by Constant HDL Optimized - Perform mod operation with a constant denominator and generate optimized HDL code - Simulink
Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | fixed point ยท Whether the output data is valid, returned as a Boolean scalar. When the value of this control signal is 1 (true), the block has successfully computed the output Y. When this value is 0 (false), the output data is not valid. ... Divisor to use for the modulus operation, specified as a positive, real-valued, finite scalar, vector, matrix, or multidimensional array.
๐ŸŒ
MathWorks
mathworks.com โ€บ matlabcentral โ€บ answers โ€บ 496017-using-the-mod-function-to-turn-a-vector-i-e-1-15-into-1-2-3-1-2-3-1-2-3-etc
Using the Mod Function to Turn a Vector (i.e. 1:15) into [1, 2, 3, 1, 2, 3, 1, 2, 3] etc. - MATLAB Answers - MATLAB Central
December 11, 2019 - I'm currently reading through the book MATLAB for Clinical and Cognitive Scientists by Mike Cohen. In the book, he mentions a 'neat trick' to covert some vector of linearly-spaced numbers (my e.g. 1:15) into a vector of numbers counting up from 1 to N over and over, using the mod function.
๐ŸŒ
MathWorks
mathworks.com โ€บ matlabcentral โ€บ answers โ€บ 1605415-how-to-get-the-argument-and-the-modulus-of-a-analytic-complex-function
how to get the argument and the modulus of a analytic complex function? - MATLAB Answers - MATLAB Central
December 7, 2021 - Soon, when you begin using MATLAB more, you will trip over things like this, and then post a frantic question here, asking why does the mod function no longer work properly in MATLAB? (Or some similarly anxious question.) So don't use names like mod. Your basic problem in that code, is the answer you want to get is not valid, at least if some of those parameters are not real numbers. But if we do this, restricting a,b,c to be all real valued, ... Note that the modulus is NOT simply a, but abs(a).
๐ŸŒ
YouTube
youtube.com โ€บ shorts โ€บ 1apcU2aonEY
How to mod or modulus in MATLAB programming language? #shorts - YouTube
In mathematics, the modulo (or "modulus" or "mod") is the remainder after dividing one number by another. We can find the modulus or mod of a number in MATLA...
Published ย  February 3, 2020
๐ŸŒ
YouTube
youtube.com โ€บ watch
Mod function in matlab: Step by step | How to use mod function in matlab | Matlab Tutorials - YouTube
the mod function in MATLAB is a step by step tutorial to understand how to use mod function in matlab. her i am explaining MATLAB's essential function mod fu...
Published ย  November 10, 2012
๐ŸŒ
MathWorks
mathworks.com โ€บ matlab โ€บ mathematics โ€บ elementary math โ€บ complex numbers
abs - Absolute value and complex magnitude - MATLAB
The complex magnitude (or modulus) is the length of a vector from the origin to a complex value plotted in the complex plane. ... The abs function fully supports tall arrays. For more information, see Tall Arrays. This function fully supports thread-based environments.
Top answer
1 of 1
2
This is only precision problem, if you accept that means a problem of understanding a floating point arithmetic environment. In MATLAB (as is true in many languages), the number 0.36 is not represented exactly as the fraction 36/100. Instead, MATLAB uses a binary form to represent the number. x = 0.36 It LOOKs like 0.36. But is it? Just like the number 1/3 is NOT representable in a finite number of digits in a decimal form, the fraction 36/100 is not representable in a finite number of binary bits. MATLAB is forced to represent that number as effectively sum(2.^[-2 -4 -5 -6 -11 -13 -17 -18 -19 -20 -22 -24 -25 -26 -31 -33 -37 -38 -39 -40 -42 -44 -45 -46 -51 -53]) which still looks vaguely like the number you wanted. But is it that? In fact, it should be an infinitely repeating number, with extra binary bits down at the botttom, just like 1/3 or 2/3 cannot be represented in decimal form. vpa(sum(sym(2).^[-2 -4 -5 -6 -11 -13 -17 -18 -19 -20 -22 -24 -25 -26 -31 -33 -37 -38 -39 -40 -42 -44 -45 -46 -51 -53]) - sym('0.36')) Now, what happens when you multiply 0.36 with 1e14? It is not an integer. That would only be true if 0.36 was exactly representable. And therefore mod gets in trouble. It does what it can. But you passed it a non-integer, so what do you expect? The same is true of each of your other cases. If you want a valid result, then you could use tools like syms (or my own HPF toolbox) to do all of your work. But expect things to be really incredibly slow. mod(sym('0.36')*1e14,256) My HPF will work, because it stores the numbers in a decimal form, and therefore 0.36 is not stored as an approximation. mod(hpf('0.36')*1e14,256) ans = 0 In the end, you will be far better off understanding floating point arithmetic than to use a powerful tool like that though.