sub

Subtract two objects using fimath object

Syntax

c = sub(F,a,b)

Description

c = sub(F,a,b) subtracts objects a and b using fimath object F.
This is helpful in cases when you want to override the fimath objects
of a and b, or if the fimath properties
associated with a and b are
different. The output fi object c has
no local fimath.

a and b must both be fi objects
and must have the same dimensions unless one is a scalar. If either a or b is
scalar, then c has the dimensions of the nonscalar
object.

Examples

In this example, c is the 32-bit difference
of a and b with fraction length
16.

but not identical. When you use sub, the fimath properties
of a and b are not modified,
and the output fi object c has
no local fimath. When you use the syntax c = a - b,
where a and b have their own fimath objects,
the output fi object c gets
assigned the same fimath object as inputs a and b.
See fimath Rules for Fixed-Point Arithmetic in the Fixed-Point Designer™ User's
Guide for more information.