fixed [fixed]
— Loadable Function: y = fixed (f)
— Loadable Function: y = fixed (is,ds)
— Loadable Function: y = fixed (is,ds,f)

Used the create a fixed point variable. Called with a single argument, if f is itself a fixed point value, then fixed is equivalent to y = f. Otherwise the integer part of f is used to create a fixed point variable with the minimum number of bits needed to represent it. f can be either real of complex.

Called with two or more arguments is represents the number of bits used to represent the integer part of the fixed point numbers, and ds the number used to represent the decimal part. These variables must be either positive integer scalars or matrices. If they are matrices they must be of the same dimension, and each fixed point number in the created matrix will have the representation given by the corresponding values of is and ds.

When creating complex fixed point values, the fixed point representation can be different for the real and imaginary parts. In this case is and ds are complex integers. Additionally the maximum value of the sum of is and ds is limited by the representation of long integers to either 30 or 62.

Called with only two arguments, the fixed point variable that is created will contain only zeros. A third argument can be used to give the values of the fixed variables elements. This third argument f can be either a fixed point variable itself, which results in a new fixed point variable being created with a different representation, or a real or complex matrix.