๐”– Scriptorium
โœฆ   LIBER   โœฆ

๐Ÿ“

Fixed-Point Designer. User's Guide


Publisher
MathWorks
Year
2023
Tongue
English
Leaves
2024
Category
Library

โฌ‡  Acquire This Volume

No coin nor oath required. For personal study only.

โœฆ Table of Contents


Fixed-Point Designer for MATLAB Code
Fixed-Point Concepts
Fixed-Point Data Types
Scaling
Compute Slope and Bias
What Is Slope Bias Scaling?
Compute Slope and Bias
Precision and Range
Range
Precision
Arithmetic Operations
Modulo Arithmetic
Two's Complement
Addition and Subtraction
Multiplication
Casts
fi Objects and C Integer Data Types
Integer Data Types
Unary Conversions
Binary Conversions
Overflow Handling
Working with fi Objects
Ways to Construct fi Objects
Use fi Constructor to Create fi Objects
Use the Insert fi Constructor Dialog to Build fi Object Constructors
Determine Property Precedence
Create fi Objects For Use in a Types Table
Cast fi Objects
Overwriting by Assignment
Ways to Cast with MATLAB Software
Set fi Object Properties
Set Fixed-Point Properties at Object Creation
Use Subscripted Assignment to Set Real-World Value of fi Object
Direct Property Referencing to Read fi Object Properties
Best Practices for Code Generation
Remove Local fimath Properties from fi Object
Working with fimath Objects
fimath Object Construction
fimath Object Syntaxes
Building fimath Object Constructors in a GUI
fimath Object Properties
Math, Rounding, and Overflow Properties
How Properties are Related
Setting fimath Object Properties
fimath Properties Usage for Fixed-Point Arithmetic
fimath Rules for Fixed-Point Arithmetic
Binary-Point Arithmetic
[Slope Bias] Arithmetic
fimath for Rounding and Overflow Modes
fimath for Sharing Arithmetic Rules
Default fimath Usage to Share Arithmetic Rules
Local fimath Usage to Share Arithmetic Rules
fimath ProductMode and SumMode
Example Setup
FullPrecision
KeepLSB
KeepMSB
SpecifyPrecision
How Functions Use fimath
Functions that use then discard attached fimath
Functions that ignore and discard attached fimath
Functions that do not perform math
Working with fipref Objects
Set fi Object Display Preferences Using fipref
Underflow and Overflow Logging Using fipref
Logging Overflows and Underflows as Warnings
Accessing Logged Information with Functions
Data Type Override Preferences Using fipref
Overriding the Data Type of fi Objects
Data Type Override for Fixed-Point Scaling
Working with numerictype Objects
numerictype Object Construction
numerictype Object Syntaxes
Example: Construct a numerictype Object with Property Name and Property Value Pairs
Example: Copy a numerictype Object
Example: Build numerictype Object Constructors in a GUI
numerictype Object Properties
Data Type and Scaling Properties
How Properties are Related
Set numerictype Object Properties
numerictype of Fixed-Point Objects
Valid Values for numerictype Object Properties
Properties That Affect the Slope
Stored Integer Value and Real World Value
numerictype Objects Usage to Share Data Type and Scaling Settings of fi objects
Example 1
Example 2
Working with quantizer Objects
Transformations for Quantized Data
Automated Fixed-Point Conversion
Fixed-Point Conversion Workflows
Choosing a Conversion Workflow
Automated Workflow
Manual Workflow
Automated Fixed-Point Conversion
Automated Fixed-Point Conversion Capabilities
Code Coverage
Proposing Data Types
Locking Proposed Data Types
Viewing Functions
Viewing Variables
Log Data for Histogram
Function Replacements
Validating Types
Testing Numerics
Detecting Overflows
Debug Numerical Issues in Fixed-Point Conversion Using Variable Logging
Prerequisites
Convert to Fixed Point Using Default Configuration
Determine Where Numerical Issues Originated
Adjust fimath Settings
Adjust Word Length Settings
Replace Constant Functions
MATLAB Language Features Supported for Automated Fixed-Point Conversion
MATLAB Language Features Supported for Automated Fixed-Point Conversion
MATLAB Language Features Not Supported for Automated Fixed-Point Conversion
Generated Fixed-Point Code
Location of Generated Fixed-Point Files
Minimizing fi-casts to Improve Code Readability
Avoiding Overflows in the Generated Fixed-Point Code
Controlling Bit Growth
Avoiding Loss of Range or Precision
Handling Non-Constant mpower Exponents
Fixed-Point Code for MATLAB Classes
Automated Conversion Support for MATLAB Classes
Unsupported Constructs
Coding Style Best Practices
Automated Fixed-Point Conversion Best Practices
Create a Test File
Prepare Your Algorithm for Code Acceleration or Code Generation
Check for Fixed-Point Support for Functions Used in Your Algorithm
Manage Data Types and Control Bit Growth
Convert to Fixed Point
Use the Histogram to Fine-Tune Data Type Settings
Optimize Your Algorithm
Avoid Explicit Double and Single Casts
Replacing Functions Using Lookup Table Approximations
Custom Plot Functions
Generate Fixed-Point MATLAB Code for Multiple Entry-Point Functions
Convert Code Containing Global Data to Fixed Point
Workflow
Declare Global Variables
Define Global Data
Define Constant Global Data
Convert Code Containing Global Variables to Fixed-Point
Convert Code Containing Structures to Fixed Point
Convert Identical Functions Called with Different Data Types
Data Type Issues in Generated Code
Enable the Highlight Option in the Fixed-Point Converter App
Enable the Highlight Option at the Command Line
Stowaway Doubles
Stowaway Singles
Expensive Fixed-Point Operations
System Objects Supported by Fixed-Point Converter App
Convert dsp.FIRFilter Object to Fixed-Point Using the Fixed-Point Converter App
Create DSP Filter Function and Test Bench
Convert the Function to Fixed-Point
Automated Conversion Using Fixed-Point Converter App
Specify Type Proposal Options
Detect Overflows
Propose Data Types Based on Simulation Ranges
Propose Data Types Based on Derived Ranges
View and Modify Variable Information
View Variable Information
Modify Variable Information
Revert Changes
Promote Sim Min and Sim Max Values
Replace the exp Function with a Lookup Table
Convert Fixed-Point Conversion Project to MATLAB Scripts
Replace a Custom Function with a Lookup Table
Visualize Differences Between Floating-Point and Fixed-Point Results
Copy Relevant Files
Prerequisites
Enable Plotting Using the Simulation Data Inspector
Add Global Variables by Using the App
Automatically Define Input Types by Using the App
Define Constant Input Parameters Using the App
Define or Edit Input Parameter Type by Using the App
Define or Edit an Input Parameter Type
Specify a String Scalar Input Parameter
Specify an Enumerated Type Input Parameter
Specify a Fixed-Point Input Parameter
Specify a Structure Input Parameter
Specify a Cell Array Input Parameter
Define Input Parameter by Example by Using the App
Define an Input Parameter by Example
Specify Input Parameters by Example
Specify a String Scalar Input Parameter by Example
Specify a Structure Type Input Parameter by Example
Specify a Cell Array Type Input Parameter by Example
Specify an Enumerated Type Input Parameter by Example
Specify a Fixed-Point Input Parameter by Example
Specify an Input from an Entry-Point Function Output Type
Specify Global Variable Type and Initial Value Using the App
Why Specify a Type Definition for Global Variables?
Specify a Global Variable Type
Define a Global Variable by Example
Define or Edit Global Variable Type
Define Global Variable Initial Value
Define Global Variable Constant Value
Remove Global Variables
Specify Properties of Entry-Point Function Inputs Using the App
Why Specify Input Properties?
Specify an Input Definition Using the App
Detect Unexecuted and Constant-Folded Code
What Is Unexecuted Code?
Detect Unexecuted Code
Fix Unexecuted Code
Automated Conversion Using Programmatic Workflow
Propose Data Types Based on Simulation Ranges
Propose Data Types Based on Derived Ranges
Detect Overflows
Replace the exp Function with a Lookup Table
Replace a Custom Function with a Lookup Table
Visualize Differences Between Floating-Point and Fixed-Point Results
Copy Relevant Files
Prerequisites
Enable Plotting Using the Simulation Data Inspector
Single-Precision Conversion
Generate Single-Precision MATLAB Code
Prerequisites
Create a Folder and Copy Relevant Files
Set Up the Single-Precision Configuration Object
Generate Single-Precision MATLAB Code
View the Type Proposal Report
View Generated Single-Precision MATLAB Code
View Potential Data Type Issues
Compare the Double-Precision and Single-Precision Variables
MATLAB Language Features Supported for Single-Precision Conversion
MATLAB Language Features Supported for Single-Precision Conversion
MATLAB Language Features Not Supported for Single-Precision Conversion
Single-Precision Conversion Best Practices
Use Integers for Index Variables
Limit Use of assert Statements
Initialize MATLAB Class Properties in Constructor
Provide a Test File That Calls Your MATLAB Function
Prepare Your Code for Code Generation
Use the -args Option to Specify Input Properties
Test Numerics and Log I/O Data
Fixed-Point Conversion โ€” Manual Conversion
Manual Fixed-Point Conversion Workflow
Manual Fixed-Point Conversion Best Practices
Create a Test File
Prepare Your Algorithm for Code Acceleration or Code Generation
Check for Fixed-Point Support for Functions Used in Your Algorithm
Manage Data Types and Control Bit Growth
Separate Data Type Definitions from Algorithm
Convert to Fixed Point
Optimize Data Types
Optimize Your Algorithm
Fixed-Point Design Exploration in Parallel
Real-Time Image Acquisition, Image Processing, and Fixed-Point Blob Analysis for Target Practice Analysis
Code Acceleration and Code Generation from MATLAB for Fixed-Point Algorithms
Code Acceleration and Code Generation from MATLAB
Requirements for Generating Compiled C Code Files
Functions Supported for Code Acceleration or C Code Generation
Workflow for Fixed-Point Code Acceleration and Generation
Accelerate Code Using fiaccel
Speeding Up Fixed-Point Execution with fiaccel
Running fiaccel
Generated Files and Locations
Data Type Override Using fiaccel
Specifying Default fimath Values for MEX Functions
File Infrastructure and Paths Setup
Compile Path Search Order
Naming Conventions
Detect and Debug Code Generation Errors
Debugging Strategies
Error Detection at Design Time
Error Detection at Compile Time
Set Up C Compiler and Compilation Options
Set Up C Compiler
C Code Compiler Configuration Object
Compilation Options Modification at the Command Line Using Dot Notation
How fiaccel Resolves Conflicting Options
MEX Configuration Dialog Box Options
See Also
Specify Configuration Parameters in Command-Line Workflow Interactively
Create and Modify Configuration Objects by Using the Dialog Box
Additional Functionalities in the Dialog Box
Best Practices for Accelerating Fixed-Point Code
Recommended Compilation Options for fiaccel
Build Scripts
Check Code Interactively Using MATLAB Code Analyzer
Separating Your Test Bench from Your Function Code
Preserving Your Code
File Naming Conventions
Code Generation Reports
Report Generation
Report Location
Errors and Warnings
Files and Functions
MATLAB Source
MATLAB Variables
Code Insights
Report Limitations
Generate C Code from Code Containing Global Data
Workflow Overview
Declaring Global Variables
Defining Global Data
Synchronizing Global Data with MATLAB
Limitations of Using Global Data
Define Input Properties Programmatically in MATLAB File
How to Use assert
Rules for Using assert Function
Specifying Properties of Primary Fixed-Point Inputs
Specifying Properties of Cell Arrays
Specifying Class and Size of Scalar Structure
Specifying Class and Size of Structure Array
Specify Cell Array Inputs at the Command Line
Specify Cell Array Inputs by Example
Specify the Type of the Cell Array Input
Make a Homogeneous Copy of a Type
Make a Heterogeneous Copy of a Type
Specify Variable-Size Cell Array Inputs
Specify Constant Cell Array Inputs
Specify Global Cell Arrays at the Command Line
Control Run-Time Checks
Types of Run-Time Checks
When to Disable Run-Time Checks
How to Disable Run-Time Checks
Fix Run-Time Stack Overflows
Code Generation with MATLAB Coder
Fixed-Point FIR Code Example Parameter Values
Accelerate Code for Variable-Size Data
Disable Support for Variable-Size Data
Control Dynamic Memory Allocation
Accelerate Code for MATLAB Functions with Variable-Size Data
Accelerate Code for a MATLAB Function That Expands a Vector in a Loop
Code Generation Readiness Tool
Issues Tab
Files Tab
Check Code Using the Code Generation Readiness Tool
Run Code Generation Readiness Tool at the Command Line
Run the Code Generation Readiness Tool From the Current Folder Browser
See Also
Check Code Using the MATLAB Code Analyzer
Fix Errors Detected at Code Generation Time
See Also
Avoid Multiword Operations in Generated Code
Find Potential Data Type Issues in Generated Code
Data Type Issues Overview
Enable Highlighting of Potential Data Type Issues
Find and Address Cumbersome Operations
Find and Address Expensive Rounding
Find and Address Expensive Comparison Operations
Find and Address Multiword Operations
Interoperability with Other Products
fi Objects with Simulink
View and Edit fi objects in Model Explorer
Reading Fixed-Point Data from the Workspace
Writing Fixed-Point Data to the Workspace
Setting the Value and Data Type of Block Parameters
Logging Fixed-Point Signals
Accessing Fixed-Point Block Data During Simulation
fi Objects with DSP System Toolbox
Reading Fixed-Point Signals from the Workspace
Writing Fixed-Point Signals to the Workspace
Ways to Generate Code
Calling Functions for Code Generation
Resolution of Function Calls for Code Generation
Key Points About Resolving Function Calls
Compile Path Search Order
When to Use the Code Generation Path
Resolution of File Types on Code Generation Path
Compilation Directive %#codegen
Use MATLAB Engine to Execute a Function Call in Generated Code
When To Declare a Function as Extrinsic
Use the coder.extrinsic Construct
Call MATLAB Functions Using feval
Working with mxArrays
Restrictions on Using Extrinsic Functions
Code Generation for Recursive Functions
Compile-Time Recursion
Run-Time Recursion
Disallow Recursion
Disable Run-Time Recursion
Recursive Function Limitations for Code Generation
Force Code Generator to Use Run-Time Recursion
Treat the Input to the Recursive Function as a Nonconstant
Make the Input to the Recursive Function Variable-Size
Assign Output Variable Before the Recursive Call
Avoid Duplicate Functions in Generated Code
Issue
Cause
Solution
Code Generation for MATLAB Classes
MATLAB Classes Definition for Code Generation
Language Limitations
Code Generation Features Not Compatible with Classes
Defining Class Properties for Code Generation
Inheritance from Built-In MATLAB Classes Not Supported
Classes That Support Code Generation
Generate Code for MATLAB Value Classes
Generate Code for MATLAB Handle Classes and System Objects
Code Generation for Handle Class Destructors
Guidelines and Restrictions
Behavioral Differences of Objects in Generated Code and in MATLAB
Class Does Not Have Property
Solution
Handle Object Limitations for Code Generation
A Variable Outside a Loop Cannot Refer to a Handle Object Allocated Inside a Loop
A Handle Object That a Persistent Variable Refers To Must Be a Singleton Object
References to Handle Objects Can Appear Undefined
System Objects in MATLAB Code Generation
Usage Rules and Limitations for System Objects for Generating Code
System Objects in codegen
System Objects in the MATLAB Function Block
System Objects in the MATLAB System Block
System Objects and MATLAB Compiler Software
Specify Objects as Inputs
Consistency Between coder.ClassType Object and Class Definition File
Limitations for Using Objects as Entry-Point Function Inputs
Work Around Language Limitation: Code Generation Does Not Support Object Arrays
Issue
Possible Solutions
Defining Data for Code Generation
Data Definition Considerations for Code Generation
Code Generation for Complex Data
Restrictions When Defining Complex Variables
Code Generation for Complex Data with Zero-Valued Imaginary Parts
Results of Expressions That Have Complex Operands
Results of Complex Multiplication with Nonfinite Values
Encoding of Characters in Code Generation
Array Size Restrictions for Code Generation
Code Generation for Constants in Structures and Arrays
Code Generation for Strings
Limitations
Differences Between Generated Code and MATLAB Code
Define String Scalar Inputs
Define String Scalar Types at the Command Line
Code Generation for Sparse Matrices
Input Definition
Code Generation Guidelines
Code Generation Limitations
Specify Array Layout in Functions and Classes
Specify Array Layout in a Function
Query Array Layout of a Function
Specify Array Layout in a Class
Code Design for Row-Major Array Layout
Linear Indexing Uses Column-Major Array Layout
Generate Code for Growing Arrays and Cell Arrays with end + 1 Indexing
Grow Array with (end + 1) Indexing
Grow Cell Array with {end + 1} Indexing
Defining Functions for Code Generation
Code Generation for Variable Length Argument Lists
Generate Code for arguments Block That Validates Input and Output Arguments
Supported Features
Names Must Be Compile-Time Constants
Using the Structure That Holds Name-Value Arguments
Differences Between Generated Code and MATLAB Code
Input Type Specification and arguments blocks
Specify Number of Entry-Point Function Input or Output Arguments to Generate
Control Number of Input Arguments
Control the Number of Output Arguments
Code Generation for Anonymous Functions
Anonymous Function Limitations for Code Generation
Code Generation for Nested Functions
Nested Function Limitations for Code Generation
Defining MATLAB Variables for C/C++ Code Generation
Variables Definition for Code Generation
Best Practices for Defining Variables for C/C++ Code Generation
Explicitly Define Variables Before Using Them
Use Caution When Reassigning Variable Properties
Define Variable Numeric Data Types
Define Matrices Before Assigning Indexed Variables
Index Arrays by Using Constant Value Vectors
Eliminate Redundant Copies of Variables in Generated Code
When Redundant Copies Occur
How to Eliminate Redundant Copies by Defining Uninitialized Variables
Defining Uninitialized Variables
Reassignment of Variable Properties
Reuse the Same Variable with Different Properties
When You Can Reuse the Same Variable with Different Properties
When You Cannot Reuse Variables
Limitations of Variable Reuse
Supported Variable Types
Edit and Represent Coder Type Objects and Properties
Object Properties
Legacy Representation of Coder Type Objects
Design Considerations for C/C++ Code Generation
When to Generate Code from MATLAB Algorithms
When Not to Generate Code from MATLAB Algorithms
Which Code Generation Feature to Use
Prerequisites for C/C++ Code Generation from MATLAB
MATLAB Code Design Considerations for Code Generation
See Also
Differences Between Generated Code and MATLAB Code
Functions that have Multiple Possible Outputs
Passing Input Argument Name at Run Time
Empty Repeating Input Argument
Output Argument Validation of Conditionally-Assigned Outputs
Writing to ans Variable
Logical Short-Circuiting
Loop Index Overflow
Indexing for Loops by Using Single Precision Operands
Index of an Unentered for Loop
Character Size
Order of Evaluation in Expressions
Name Resolution While Constructing Function Handles
Termination Behavior
Size of Variable-Size N-D Arrays
Size of Empty Arrays
Size of Empty Array That Results from Deleting Elements of an Array
Growing Variable-Size Column Cell Array That is Initialized as Scalar at Run Time
Binary Element-Wise Operations with Single and Double Operands
Floating-Point Numerical Results
NaN and Infinity
Negative Zero
Code Generation Target
MATLAB Class Property Initialization
MATLAB Classes in Nested Property Assignments That Have Set Methods
MATLAB Handle Class Destructors
Variable-Size Data
Complex Numbers
Converting Strings with Consecutive Unary Operators to double
Display Function
Potential Differences Reporting
Addressing Potential Differences Messages
Disabling and Enabling Potential Differences Reporting for MATLAB Coder
Disabling and Enabling Potential Differences Reporting for Fixed-Point Designer
Potential Differences Messages
Automatic Dimension Incompatibility
mtimes No Dynamic Scalar Expansion
Matrix-Matrix Indexing
Vector-Vector Indexing
Loop Index Overflow
MATLAB Language Features Supported for C/C++ Code Generation
MATLAB Features That Code Generation Supports
MATLAB Language Features That Code Generation Does Not Support
Code Generation for Enumerated Data
Code Generation for Enumerations
Define Enumerations for Code Generation
Allowed Operations on Enumerations
MATLAB Toolbox Functions That Support Enumerations
Customize Enumerated Types in Generated Code
Specify a Default Enumeration Value
Specify a Header File
Include Class Name Prefix in Generated Enumerated Type Value Names
Generate C++11 Code Containing Ordinary C Enumeration
Code Generation for Categorical Arrays
Code Generation for Categorical Arrays
Define Categorical Arrays for Code Generation
Allowed Operations on Categorical Arrays
MATLAB Toolbox Functions That Support Categorical Arrays
Define Categorical Array Inputs
Define Categorical Array Inputs at the Command Line
Representation of Categorical Arrays
Categorical Array Limitations for Code Generation
Code Generation for Datetime Arrays
Code Generation for Datetime Arrays
Define Datetime Arrays for Code Generation
Allowed Operations on Datetime Arrays
MATLAB Toolbox Functions That Support Datetime Arrays
Define Datetime Array Inputs
Define Datetime Array Inputs at the Command Line
Representation of Datetime Arrays
Datetime Array Limitations for Code Generation
Code Generation for Duration Arrays
Code Generation for Duration Arrays
Define Duration Arrays for Code Generation
Allowed Operations on Duration Arrays
MATLAB Toolbox Functions That Support Duration Arrays
Define Duration Array Inputs
Define Duration Array Inputs at the Command Line
Representation of Duration Arrays
Duration Array Limitations for Code Generation
Code Generation for Function Handles
Function Handle Limitations for Code Generation
Code Generation for MATLAB Structures
Structure Definition for Code Generation
Structure Operations Allowed for Code Generation
Define Scalar Structures for Code Generation
Restrictions When Defining Scalar Structures by Assignment
Adding Fields in Consistent Order on Each Control Flow Path
Restriction on Adding New Fields After First Use
Define Arrays of Structures for Code Generation
Ensuring Consistency of Fields
Using repmat to Define an Array of Structures with Consistent Field Properties
Defining an Array of Structures by Using struct
Defining an Array of Structures Using Concatenation
Index Substructures and Fields
Assign Values to Structures and Fields
Pass Large Structures as Input Parameters
Functions, Classes, and System Objects Supported for Code Generation
Functions and Objects Supported for C/C++ Code Generation
Code Generation for Tables
Code Generation for Tables
Define Tables for Code Generation
Allowed Operations on Tables
MATLAB Toolbox Functions That Support Tables
Define Table Inputs
Define Table Inputs at the Command Line
Representation of Tables
Table Limitations for Code Generation
Creating Tables Limitations
Modifying Tables Limitations
Using Table Functions Limitations
Code Generation for Timetables
Code Generation for Timetables
Define Timetables for Code Generation
Allowed Operations on Timetables
MATLAB Toolbox Functions That Support Timetables
Define Timetable Inputs
Define Timetable Inputs at the Command Line
Representation of Timetables
Timetable Limitations for Code Generation
Creating Timetables Limitations
Modifying Timetables Limitations
Using Timetable Functions Limitations
Code Generation for Variable-Size Data
Code Generation for Variable-Size Arrays
Memory Allocation for Variable-Size Arrays
Enabling and Disabling Support for Variable-Size Arrays
Variable-Size Arrays in a Code Generation Report
Control Memory Allocation for Variable-Size Arrays
Provide Upper Bounds for Variable-Size Arrays
Disable Dynamic Memory Allocation
Configure Code Generator to Use Dynamic Memory Allocation for Arrays Bigger Than a Threshold
Control Dynamic Memory Allocation for Fixed-Size Arrays
Enable Dynamic Memory Allocation for Fixed-Size Arrays
Dynamic Memory Allocation Threshold for Fixed-Size Arrays
Generating Code for Fixed-Size Arrays
Usage Notes and Limitations
Specify Upper Bounds for Variable-Size Arrays
Specify Upper Bounds for Variable-Size Inputs
Specify Upper Bounds for Local Variables
Define Variable-Size Data for Code Generation
Use a Matrix Constructor with Nonconstant Dimensions
Assign Multiple Sizes to the Same Variable
Growing an Array by Using (end + 1)
Define Variable-Size Data Explicitly by Using coder.varsize
Diagnose and Fix Variable-Size Data Errors
Diagnosing and Fixing Size Mismatch Errors
Diagnosing and Fixing Errors in Detecting Upper Bounds
Incompatibilities with MATLAB in Variable-Size Support for Code Generation
Incompatibility with MATLAB for Scalar Expansion
Incompatibility with MATLAB in Determining Size of Variable-Size N-D Arrays
Incompatibility with MATLAB in Determining Size of Empty Arrays
Incompatibility with MATLAB in Determining Class of Empty Arrays
Incompatibility with MATLAB in Matrix-Matrix Indexing
Incompatibility with MATLAB in Vector-Vector Indexing
Incompatibility with MATLAB in Matrix Indexing Operations for Code Generation
Incompatibility with MATLAB in Concatenating Variable-Size Matrices
Differences When Curly-Brace Indexing of Variable-Size Cell Array Inside Concatenation Returns No Elements
Variable-Sizing Restrictions for Code Generation of Toolbox Functions
Common Restrictions
Toolbox Functions with Restrictions for Variable-Size Data
Generate Code With Implicit Expansion Enabled
Output Size
Additional Code Generation
Performance Variation
Optimize Implicit Expansion in Generated Code
Disable Implicit Expansion in Specified Function by Using coder.noImplicitExpansionInFunction
Disable Implicit Expansion for Specific Binary Operation by Using coder.sameSizeBinaryOp
Disable Implicit Expansion in your Project
Representation of Arrays in Generated Code
Customize Interface Generation
Control Memory Allocation for Fixed-Size Arrays
Enable Dynamic Memory Allocation for All Fixed-Size Arrays
Enable Dynamic Memory Allocation for Arrays Bigger Than a Threshold
Resolve Error: Size Mismatches
Issue
Possible Solutions
Code Generation for Cell Arrays
Code Generation for Cell Arrays
Homogeneous vs. Heterogeneous Cell Arrays
Controlling Whether a Cell Array Is Homogeneous or Heterogeneous
Cell Arrays in Reports
Control Whether a Cell Array Is Variable-Size
Define Cell Array Inputs
Cell Array Limitations for Code Generation
Cell Array Element Assignment
Variable-Size Cell Arrays
Definition of Variable-Size Cell Array by Using cell
Cell Array Indexing
Growing a Cell Array by Using {end + 1}
Cell Array Contents
Passing Cell Arrays to External C/C++ Functions
Primary Functions
Specify Properties of Entry-Point Function Inputs
Why You Must Specify Input Properties
Properties to Specify
Rules for Specifying Properties of Primary Inputs
Methods for Defining Properties of Primary Inputs
Define Input Properties by Example at the Command Line
Specify Constant Inputs at the Command Line
Specify Variable-Size Inputs at the Command Line
Input Type Specification and arguments blocks
Define Input Properties Programmatically in the MATLAB File
How to Use assert with MATLAB Coder
Rules for Using assert Function
Specifying General Properties of Primary Inputs
Specifying Properties of Primary Fixed-Point Inputs
Specifying Properties of Cell Arrays
Specifying Class and Size of Scalar Structure
Specifying Class and Size of Structure Array
Create and Edit Input Types by Using the Coder Type Editor
Open the Coder Type Editor
Common Editor Actions
Type Browser Pane
Type Properties Pane
MATLAB Code Pane
System Objects Supported for Code Generation
Code Generation for System Objects
Half Precision in MATLAB
Half Precision Code Generation Support
Generate Native Half-Precision C Code Using MATLAB Coder
Generate Native Half-Precision C Code for ARMยฎ Cortexยฎ-A with GCC Compiler
Generate Native Half-Precision C Code for ARM Cortex-A with Armclang Compiler
Register ARM Target Hardware with Custom Language Implementation
What is Half Precision?
Half Precision Applications
Benefits of Using Half Precision in Embedded Applications
Half Precision in MATLAB
Half Precision in Simulink
Code Generation with Half Precision
Fixed-Point Designer for Simulink Models
Getting Started
Sharing Fixed-Point Models
Physical Quantities and Measurement Scales
Introduction
Selecting a Measurement Scale
Select a Measurement Scale for Temperature
Why Use Fixed-Point Hardware?
Why Use the Fixed-Point Designer Software?
Developing and Testing Fixed-Point Systems
Supported Data Types
Configure Blocks with Fixed-Point Output
Specify the Output Data Type and Scaling
Specify Fixed-Point Data Types with the Data Type Assistant
Rounding
Overflow Handling
Lock the Output Data Type Setting
Real-World Values Versus Stored Integer Values
Configure Blocks with Fixed-Point Parameters
Specify Fixed-Point Values Directly
Specify Fixed-Point Values Via Parameter Objects
Pass Fixed-Point Data Between Simulink Models and MATLAB
Read Fixed-Point Data from the Workspace
Write Fixed-Point Data to the Workspace
Log Fixed-Point Signals
Access Fixed-Point Block Data During Simulation
Cast from Doubles to Fixed Point
Simulate Using Binary-Point-Only Scaling
Simulate Using [Slope Bias] Scaling
Data Types and Scaling
Data Types and Scaling in Digital Hardware
Fixed-Point Data Types
Binary Point Interpretation
Floating-Point Data Types
Scaling
Binary-Point-Only Scaling
Slope and Bias Scaling
Unspecified Scaling
Quantization
Fixed-Point Format
Range and Precision
Range
Precision
Fixed-Point Data Type Parameters
Range and Precision of an 8-Bit Fixed-Point Data Type โ€” Binary-Point-Only Scaling
Range and Precision of an 8-Bit Fixed-Point Data Type โ€” Slope and Bias Scaling
Fixed-Point Numbers in Simulink
Fixed-Point Data Type and Scaling Notation
Display Port Data Types
Scaled Doubles
What Are Scaled Doubles?
When to Use Scaled Doubles
Use Scaled Doubles to Avoid Precision Loss
Floating-Point Numbers
Floating-Point Numbers
Scientific Notation
IEEE 754 Standard for Floating-Point Numbers
Range and Precision
Exceptional Arithmetic
Arithmetic Operations
Rounding
Choosing a Rounding Method
Rounding Modes for Fixed-Point Simulink Blocks
Fixed-Point Designer Rounding Modes
Rounding Mode: Ceiling
Rounding Mode: Convergent
Rounding Mode: Floor
Rounding Mode: Nearest
Rounding Mode: Round
Rounding Mode: Simplest
Optimize Rounding for Casts
Optimize Rounding for High-Level Arithmetic Operations
Optimize Rounding for Intermediate Arithmetic Operations
Rounding Mode: Zero
Rounding to Zero Versus Truncation
Maximize Precision
Pad with Trailing Zeros
Constant Scaling for Best Precision
Net Slope and Net Bias Precision
What are Net Slope and Net Bias?
Detect Net Slope and Net Bias Precision Issues
Fixed-Point Constant Underflow
Fixed-Point Constant Overflow
Fixed-Point Constant Precision Loss
Detect Fixed-Point Constant Precision Loss
Open the Model
Detect Fixed-Point Constant Precision Loss
Saturation and Wrapping
What Are Saturation and Wrapping?
Saturation and Wrapping
Guard Bits
Determine the Range of Fixed-Point Numbers
Handle Overflows in Simulink Models
Open the Model
Simulate Model with Original Diagnostic Settings
Adjust Diagnostic Settings
Recommendations for Arithmetic and Scaling
Arithmetic Operations and Fixed-Point Scaling
Addition
Accumulation
Multiplication
Gain
Division
Summary
Parameter and Signal Conversions
Introduction
Parameter Conversions
Signal Conversions
Rules for Arithmetic Operations
Computational Units
Addition and Subtraction
Multiplication
Division
Shifts
The Summation Process
The Multiplication Process
The Division Process
Shifts
Shifting Bits to the Right
Conversions and Arithmetic Operations
Realization Structures
Realizing Fixed-Point Digital Filters
Introduction
Realizations and Data Types
Targeting an Embedded Processor
Introduction
Size Assumptions
Operation Assumptions
Design Rules
Canonical Forms
Fixed-Point Advisor
Use the Fixed-Point Tool to Prepare a System for Conversion
Preparation Checks
Fixed-Point Tool
Data Type Conversion Overview
Methods for Converting a System to Fixed Point
Run Management
Convert a Referenced Model to Fixed Point
Open ex_mdlref_controller Model
View Model Hierarchy in the Fixed-Point Tool
Viewing Simulation Ranges for Referenced Models
Propose Data Types for a Referenced Model
Control Views in the Fixed-Point Tool
Filter Results by Run
Filter Results by Subsystem
Control Column Views
Use the Explore Tab to Sort and Filter Results
Model Multiple Data Type Behaviors Using a Data Dictionary
Open the Model
Explore How the Data Dictionary is Used in the Model
Change Data Types of Model Parameters
Compare Numerical Response of Sum Block and Sum in MATLAB Function Block
Convert Floating-Point Model to Fixed Point
Convert Floating-Point Model to Fixed Point
Set up the Model
Prepare System for Conversion
Collect Ranges
Convert Data Types
Verify New Settings
Replace Unsupported Blocks with a Lookup Table Approximation
Verify Behavior of System with Lookup Table Approximation
Explore Multiple Floating-Point to Fixed-Point Conversions
Set up the Model
Convert to Fixed-Point Using Default Proposal Settings
Convert Using New Proposal Settings
Optimize Fixed-Point Data Types for a System
Best Practices for Optimizing Data Types
Model Management and Exploration
Optimize Fixed-Point Data Types
Optimize Data Types Using Multiple Simulation Scenarios
Optimize Data Types for an FPGA with DSP Slices
Use Data Type Optimization to Minimize Operator Counts
Open the Model
Define Tolerances and Settings
Image Denoising Using Fixed-Point Quantized Restricted Boltzmann Machine Algorithm
Optimize the Fixed-Point Data Types of a System Using the Fixed-Point Tool
Open Model and Define Simulation Scenarios
Prepare System for Conversion
Optimize Data Types in the Fixed-Point Tool
Examine Results
Apply Optimized Data Types to the Model
Export Optimization Workflow Steps to a MATLAB Script
Perform Data Type Optimization with Custom Behavioral Constraints
Producing Lookup Table Data
Producing Lookup Table Data
Worst-Case Error for a Lookup Table
Approximate the Square Root Function
Create Lookup Tables for a Sine Function
Introduction
Set Function Parameters for the Lookup Table
Specifying Both errmax and nptsmax
Comparison of Example Results
Use Lookup Table Approximation Functions
Optimize Lookup Tables for Memory-Efficiency
Optimize an Existing Lookup Table Using the Lookup Table Optimizer
Edit the Optimization Settings and Generate a New Approximate
Optimize Lookup Tables for Memory-Efficiency Programmatically
Approximate a Function Using a Lookup Table
Optimize an Existing Lookup Table
Visualize Pareto Front for Memory Optimization Versus Absolute Tolerance
Compare Approximations Using On Curve and Off Curve Table Values
Generate an Optimized Lookup Table as a MATLAB Function
Generate an Optimized Lookup Table as a MATLAB Function Programmatically
Convert Neural Network Algorithms to Fixed-Point Using fxpopt and Generate HDL Code
Convert Neural Network Algorithms to Fixed Point and Generate C Code
Effects of Spacing on Speed, Error, and Memory Usage
Criteria for Comparing Types of Breakpoint Spacing
Model That Illustrates Effects of Breakpoint Spacing
Data ROM Required for Each Lookup Table
Determination of Out-of-Range Inputs
How the Lookup Tables Determine Input Location
Interpolation for Each Lookup Table
Summary of the Effects of Breakpoint Spacing
Approximate Functions with a Direct Lookup Table
Generate a Two-Dimensional Direct Lookup Table Approximation
Generate a Direct Lookup Table Approximation for a Subsystem
Convert Digit Recognition Neural Network to Fixed Point and Generate C Code
Calculate Complex dB Using a Direct Lookup Table
Optimize Lookup Tables for Periodic Functions
Replace Fitted Curve with Optimized Lookup Table
Automatic Data Typing
Choosing a Range Collection Method
Best Practices for Fixed-Point Conversion Workflow
Enable Signal Logging
Back Up Your Simulink Model
Convert Individual Subsystems
Do Not Use โ€œSave asโ€ on Referenced Models and MATLAB Function blocks
Use Lock Output Data Type Setting
Save Simulink Signal Objects
Do Not Use clear all
Models That Might Cause Data Type Propagation Errors
Iterative Fixed-Point Conversion Using the Fixed-Point Tool
Workflow for Automatic Data Typing
Set Up the Model
Prepare System for Conversion
Set Up the Model
Select the System Under Design
Set Range Collection Method
Specify Simulation Input
Edit Signal Tolerances
Prepare the System for Conversion
Specify Behavioral Constraints
Specify Signal Tolerances
Use Model Verification Blocks
Collect Ranges
Collect Ranges
Explore Collected Ranges
Convert Data Types
Edit Proposal Settings
Propose Data Types
Apply Proposed Data Types
Examine Results to Resolve Conflicts
Proposed Data Type Summary
Needs Attention
Range Information
Examine the Results and Resolve Conflicts
Verify New Settings
Simulate Using Embedded Types
Examine Visualization
Compare Results
Explore Additional Data Types
Edit Proposal Settings
Propose, Apply, Simulate, Compare
Iterate
Restore Model to Original State
Restore Model to Original State
Get Proposals for Results with Inherited Types
How to Get Proposals for Objects That Use an Inherited Output Data Type
When the Fixed-Point Tool Will Not Propose for Inherited Data Types
Rescale a Fixed-Point Model
About the Feedback Controller Example Model
Explore the Numerical Behavior of the Model
Propose Fraction Lengths Using Simulation Range Data
How the Fixed-Point Tool Proposes Data Types
How the Fixed-Point Tool Uses Range Information
How the Fixed-Point Tool Uses Target Hardware Information
How to Get Proposals for Objects That Use an Inherited Output Data Type
When the Fixed-Point Tool Will Not Propose for Inherited Data Types
How Hardware Implementation Settings Affect Data Type Proposals
Open the Model and Specify Hardware Implementation Settings
Propose Word Lengths Based on Simulation Data
Propose Data Types For Merged Simulation Ranges
Set up the Model
Open the Fixed-Point Tool and Prepare the System for Conversion
Collect Ranges and Convert to Fixed-Point
Verify Fixed-Point Behavior
View Simulation Results
Compare Runs
Histogram Plot of Signal
Fixed-Point Instrumentation and Data Type Override
Control Instrumentation Settings
Control Data Type Override
Instrumentation Settings and Data Type Override for a Model Reference Hierarchy
Data Type Override Limitations
Model Configuration Changes Made During Data Type Optimization
Detect downcast
Detect underflow
Detect precision loss
Detect overflow
Wrap on overflow
Saturate on overflow
Signal logging
Single simulation output
Format
Time
Output
Simulation range checking
Show port data types
Simulation mode
Data type override
Range Analysis
How Range Analysis Works
Analyzing a Model with Range Analysis
Automatic Stubbing
Model Compatibility with Range Analysis
How to Derive Ranges
Derive Ranges at the Subsystem Level
When to Derive Ranges at the Subsystem Level
Derive Ranges at the Subsystem Level
Derive Ranges Using Design Ranges
Open the Model and View Design Ranges
Derive Ranges
Derive Ranges Using Block Initial Conditions
Open the Model
Derive Ranges
Derive Ranges for Simulink.Parameter Objects
Open the ex_derived_min_max_3 Model
Examine Gain Parameters
Derive Ranges
Insufficient Design Range Information
Open the ex_derived_min_max_4 Model
Collect Ranges
Fix Insufficient Design Ranges
Troubleshoot Range Analysis of System Objects
Provide More Design Range Information
Open Model
Collect Ranges in the Fixed-Point Tool
Provide Additional Design Range Information
Fix Design Range Conflicts
Open Model
Collect Ranges in the Fixed-Point Tool
Fix Design Range Conflicts
Intermediate Range Results
Open Model
Collect Ranges in the Fixed-Point Tool
Propose Data Types
Inspect Result Details
Unsupported Simulink Software Features
Simulink Blocks Supported for Range Analysis
Overview of Simulink Block Support
Limitations of Support for Model Blocks
Range Collection Workflows
Use the Fixed-Point Tool to Explore Numerical Behavior
Open the Fixed-Point Direct Form Filter Model
Set Up the Model
Open the Fixed-Point Tool and Collect Ranges
Explore Fixed-Point Behavior of the Model
Use Custom Data Type Override Settings for Range Collection
Working with the MATLAB Function Block
Convert MATLAB Function Block to Fixed Point
Best Practices for Working with the MATLAB Function Block in the Fixed-Point Tool
Open the Model
Prepare for Fixed-Point Conversion
Collect Range Information
Propose Data Types
Inspect Code Using the Code View
Apply Proposed Data Types
Verify Results
Replace Functions in a MATLAB Function Block with a Lookup Table
Open the Model
Replace Sine Function with Lookup Table Approximation
Best Practices for Working with the MATLAB Function Block in Automated Fixed-Point Conversion Workflows
Unsupported MATLAB Function Block Features
Control Data Types and Generate Code with MATLAB Function Block
Data Type Override with MATLAB Function Block
Fixed-Point Data Types with MATLAB Function Block
Share Models Containing Fixed-Point MATLAB Function Blocks
Specify Fixed-Point Math Properties in MATLAB Function Block
Generate Fixed-Point FIR Code Using MATLAB Function Block
Program the MATLAB Function Block
Prepare the Inputs
Create the Model
Define the fimath Object Using the Model Explorer
Run the Simulation
Working with Data Objects in the Fixed-Point Workflow
Bus Objects in the Fixed-Point Workflow
How Data Type Proposals Are Determined for Bus Objects
Bus Naming Conventions with Data Type Override
Limitations of Bus Objects in the Fixed-Point Workflow
Autoscaling Data Objects Using the Fixed-Point Tool
Collecting Ranges for Data Objects
Data Type Constraints in Data Objects
Autoscale a Model Using Data Objects for Data Type Definitions
Command Line Interface for the Fixed-Point Tool
The Command-Line Interface for the Fixed-Point Tool
Convert a Model to Fixed Point Using the Command Line
Code Generation
Fixed-Point Code Generation Support
Introduction
Languages
Data Types
Rounding Modes
Overflow Handling
Blocks
Scaling
Accelerating Fixed-Point Models
Using External Mode or Rapid Simulation Target
Introduction
External Mode
Rapid Simulation Target
Net Slope Computation
Handle Net Slope Computation
Use Division to Handle Net Slope Computation
Improve Numerical Accuracy of Simulation Results with Rational Approximations to Handle Net Slope
Improve Efficiency of Generated Code with Rational Approximations to Handle Net Slope
Use Integer Division to Handle Net Slope Computation
Control the Generation of Fixed-Point Utility Functions
Optimize Generated Code Using Specified Minimum and Maximum Values
Eliminate Unnecessary Utility Functions Using Specified Minimum and Maximum Values
Optimize Generated Code with the Model Advisor
Identify Blocks that Generate Expensive Fixed-Point and Saturation Code
Identify Questionable Fixed-Point Operations
Identify Blocks that Generate Expensive Rounding Code
Lookup Table Optimization
Selecting Data Types for Basic Operations
Restrict Data Type Word Lengths
Avoid Fixed-Point Scalings with Bias
Wrap and Round to Floor or Simplest
Limit the Use of Custom Storage Classes
Use of Shifts by C Code Generation Products
Introduction to Shifts by Code Generation Products
Modeling Sources of Shifts
Controlling Shifts in Generated Code
Use Hardware-Efficient Algorithm to Solve Systems of Complex-Valued Linear Equations
Implement Hardware-Efficient QR Decomposition Using CORDIC in a Systolic Array
Perform QR Factorization Using CORDIC
Implement Hardware-Efficient Real Partial-Systolic Matrix Solve Using QR Decomposition
Implement Hardware-Efficient Real Partial-Systolic Matrix Solve Using Q-less QR Decomposition
Implement Hardware-Efficient Real Burst Matrix Solve Using QR Decomposition
Implement Hardware-Efficient Real Burst Matrix Solve Using Q-less QR Decomposition
Implement Hardware-Efficient Real Partial-Systolic QR Decomposition
Implement Hardware-Efficient Real Partial-Systolic Q-less QR Decomposition
Implement Hardware-Efficient Real Burst QR Decomposition
Implement Hardware-Efficient Real Burst Q-less QR Decomposition
Implement Hardware-Efficient Complex Partial-Systolic Matrix Solve Using QR Decomposition
Implement Hardware-Efficient Complex Partial-Systolic Matrix Solve Using Q-less QR Decomposition
Implement Hardware-Efficient Complex Burst Matrix Solve Using QR Decomposition
Implement Hardware-Efficient Complex Burst Matrix Solve Using Q-less QR Decomposition
Implement Hardware-Efficient Complex Partial-Systolic QR Decomposition
Implement Hardware-Efficient Complex Partial-Systolic Q-less QR Decomposition
Implement Hardware-Efficient Complex Burst QR Decomposition
Implement Hardware-Efficient Complex Burst Q-less QR Decomposition
Implement Hardware-Efficient Real Partial-Systolic Matrix Solve Using QR Decomposition with Diagonal Loading
Implement Hardware-Efficient Complex Partial-Systolic Matrix Solve Using QR Decomposition with Diagonal Loading
Determine Fixed-Point Types for QR Decomposition
Determine Fixed-Point Types for Q-less QR Decomposition
Algorithms to Determine Fixed-Point Types for Complex Q-less QR Matrix Solve A'AX=B
Determine Fixed-Point Types for Complex Q-less QR Matrix Solve A'AX=B
Algorithms to Determine Fixed-Point Types for Complex Least-Squares Matrix Solve AX=B
Determine Fixed-Point Types for Complex Least-Squares Matrix Solve AX=B
Algorithms to Determine Fixed-Point Types for Real Q-less QR Matrix Solve A'AX=B
Determine Fixed-Point Types for Real Q-less QR Matrix Solve A'AX=B
Algorithms to Determine Fixed-Point Types for Real Least-Squares Matrix Solve AX=B
Determine Fixed-Point Types for Real Least-Squares Matrix Solve AX=B
Compute Forgetting Factor Required for Streaming Input Data
Estimate Standard Deviation of Quantization Noise of Complex-Valued Signal
Estimate Standard Deviation of Quantization Noise of Real-Valued Signal
Implement Hardware-Efficient Real Partial-Systolic Q-less QR with Forgetting Factor
Implement Hardware-Efficient Complex Partial-Systolic Q-less QR with Forgetting Factor
Implement Hardware-Efficient Real Partial-Systolic Matrix Solve Using Q-less QR Decomposition with Forgetting Factor
Implement Hardware-Efficient Complex Partial-Systolic Matrix Solve Using Q-less QR Decomposition with Forgetting Factor
Implement Hardware-Efficient Complex Burst Matrix Solve Using QR Decomposition with Tikhonov Regularization
Implement Hardware-Efficient Complex Burst Matrix Solve Using Q-less QR Decomposition with Tikhonov Regularization
Implement Hardware-Efficient Complex Partial-Systolic Matrix Solve Using QR Decomposition with Tikhonov Regularization
Implement Hardware-Efficient Complex Partial-Systolic Matrix Solve Using Q-less QR Decomposition with Tikhonov Regularization
Implement Hardware-Efficient Real Burst Matrix Solve Using QR Decomposition with Tikhonov Regularization
Implement Hardware-Efficient Real Burst Matrix Solve Using Q-less QR Decomposition with Tikhonov Regularization
Implement Hardware-Efficient Real Partial-Systolic Matrix Solve Using QR Decomposition with Tikhonov Regularization
Implement Hardware-Efficient Real Partial-Systolic Matrix Solve Using Q-less QR Decomposition with Tikhonov Regularization
Determine Fixed-Point Types for Complex Least-Squares Matrix Solve with Tikhonov Regularization
Determine Fixed-Point Types for Complex Q-less QR Matrix Solve with Tikhonov Regularization
Determine Fixed-Point Types for Real Least-Squares Matrix Solve with Tikhonov Regularization
Determine Fixed-Point Types for Real Q-less QR Matrix Solve with Tikhonov Regularization
Implement Hardware-Efficient Real Burst Q-less QR with Forgetting Factor
Implement Hardware-Efficient Complex Burst Q-less QR with Forgetting Factor
Implement Hardware-Efficient Real Burst Matrix Solve Using Q-less QR Decomposition with Forgetting Factor
Implement Hardware-Efficient Complex Burst Matrix Solve Using Q-less QR Decomposition with Forgetting Factor
Implement Hardware-Efficient Real Burst Asynchronous Matrix Solve Using Q-less QR Decomposition
Implement Hardware-Efficient Complex Burst Asynchronous Matrix Solve Using Q-less QR Decomposition
How to Use Square Jacobi SVD HDL Optimized Block
Implement HDL Optimized SVD in Feedforward Fashion Without Backpressure
Implement HDL Optimized SVD with Backpressure Signal and HDL FIFO Block
Troubleshooting
Fixed-Point Versus Built-in Integer Types
Negative Fraction Length
Fraction Length Greater Than Word Length
fi Constructor Does Not Follow globalfimath Rules
Issue
Possible Solutions
Decide Which Workflow is Right for Your Application
Tips for Making Generated Code More Efficient
fimath Settings for Efficient Code
Replace Functions With More Efficient Fixed-Point Implementations
Know When a Function is Supported for Instrumentation and Acceleration
Resolve Error: Function is not Supported for Fixed-Point Conversion
Issue
Possible Solutions
Resolve Error: fi*non-fi
Issue
Possible Solution
Resolve Error: Data Type Mismatch
Issue
Possible Solution
Resolve Error: Mismatched fimath
Issue
Possible Solutions
Why Does the Fixed-Point Converter App Not Propose Data Types for System Objects?
Slow Operations in the Fixed-Point Converter App
Blocks That Do Not Support Fixed-Point Data Types
Issue
Possible Solutions
Prevent the Fixed-Point Tool from Overriding Integer Data Types
The Fixed-Point Tool did not Propose Data Types
Issue
Possible Solutions
Fraction Lengths and Fixed-Point Numbers
Fraction Length Greater Than Word Length
Negative Fraction Length
Why am I missing data type proposals for MATLAB Function block variables?
Data Type Propagation Errors After Applying Proposed Data Types
Shared Data Type Groups
Block Constraints
Internal Block Rules
Resolve Range Analysis Issues
Issue
Possible Solutions
Data Type Mismatch and Structure Initial Conditions
Specify Bus Signal Initial Conditions Using Simulink.Parameter Objects
Data Type Mismatch and Masked Atomic Subsystems
Reconversion Using the Fixed-Point Tool
Data Type Optimization Not Successful
Issue
Possible Solutions
Compile-Time Recursion Limit Reached
Issue
Cause
Solutions
Force Run-Time Recursion
Increase the Compile-Time Recursion Limit
Output Variable Must Be Assigned Before Run-Time Recursive Call
Issue
Cause
Solution
Unable to Determine That Every Element of Cell Array Is Assigned
Issue
Cause
Solution
Nonconstant Index into varargin or varargout in a for-Loop
Issue
Cause
Solution
Single-Precision Conversion in Simulink
Getting Started with Single Precision Converter
Select System Under Design
Check Compatibility
Convert
Verify
Convert a System to Single Precision
Open Model
Convert to Single Precision
Simulink Half Precision
The Half-Precision Data Type in Simulink
Math Operations in Half-Precision
Software Features Supported for Half Precision
Generate Code for Half Precision Systems
Generate Native Half-Precision C Code from Simulink Models
Generate Native Half-Precision C Code for ARM Cortex-A with Armclang Compiler
Register ARM Cortex-A with GCC Compiler
Register ARM Target Hardware with Custom Language Implementation
Register Other Hardware Targets for Half Precision
Half-Precision Field-Oriented Control Algorithm
Image Quantization with Half-Precision Data Types
Convert Single Precision Lookup Table to Half Precision
Digit Classification with Half-Precision Data Types
Design Cost Estimation
Design Cost Model Metrics
Data Segment Estimate
Operator Count
How to Collect Design Cost Metrics
Open Project
Collect Metric Results
Access High-Level Results Programmatically
Generate Report to Access Detailed Results
Operator Count
Data Segment Table
Fixed-Point HDL-Optimized Blocks
Choose a Block for HDL-Optimized Fixed-Point Matrix Operations
Define the Problem to Solve
Choose an Architecture
Linear System Solvers: Select Synchronous or Asynchronous Operation
Data Complexity
Hardware Control Signals
Writing Fixed-Point S-Functions
Data Type Support
Supported Data Types
The Treatment of Integers
Data Type Override
Structure of the S-Function
Storage Containers
Introduction
Storage Containers in Simulation
Storage Containers in Code Generation
Data Type IDs
The Assignment of Data Type IDs
Registering Data Types
Setting and Getting Data Types
Getting Information About Data Types
Converting Data Types
Overflow Handling and Rounding Methods
Tokens for Overflow Handling and Rounding Methods
Overflow Logging Structure
Create MEX-Files
Fixed-Point S-Function Examples
Get the Input Port Data Type
Set the Output Port Data Type
Interpret an Input Value
Write an Output Value
Determine Output Type Using the Input Type
API Function Reference
ssFxpConvert
ssFxpConvertFromRealWorldValue
ssFxpConvertToRealWorldValue
ssFxpGetU32BitRegion
ssFxpGetU32BitRegionCompliant
ssFxpSetU32BitRegion
ssFxpSetU32BitRegionCompliant
ssGetDataTypeBias
ssGetDataTypeFixedExponent
ssGetDataTypeFracSlope
ssGetDataTypeFractionLength
ssGetDataTypeFxpContainWordLen
ssGetDataTypeFxpIsSigned
ssGetDataTypeFxpWordLength
ssGetDataTypeIsDoubleSingleorHalf
ssGetDataTypeIsFixedPoint
ssGetDataTypeIsFloatingPoint
ssGetDataTypeIsFxpFltApiCompat
ssGetDataTypeIsHalfPrecision
ssGetDataTypeIsScalingPow2
ssGetDataTypeIsScalingTrivial
ssGetDataTypeNumberOfChunks
ssGetDataTypeStorageContainCat
ssGetDataTypeStorageContainerSize
ssGetDataTypeTotalSlope
ssLogFixptInstrumentation
ssRegisterDataTypeFxpBinaryPoint
ssRegisterDataTypeFxpFSlopeFixExpBias
ssRegisterDataTypeFxpScaledDouble
ssRegisterDataTypeFxpSlopeBias
ssRegisterDataTypeHalfPrecision
Fixed-Point Designer Examples
Create Fixed-Point Data
Perform Fixed-Point Arithmetic
Set Fixed-Point Math Attributes
View Fixed-Point Number Circles
Perform Binary-Point Scaling
Compute Quantization Error
Detect Limit Cycles in Fixed-Point State-Space Systems
Develop Fixed-Point Algorithms
Perform QR Factorization Using CORDIC
Compute Square Root Using CORDIC
Normalize Data for Lookup Tables
Implement Fixed-Point Log2 Using Lookup Table
Implement Fixed-Point Square Root Using Lookup Table
Convert Fast Fourier Transform (FFT) to Fixed Point
Set Data Types Using Min/Max Instrumentation
Implement FIR Filter Algorithm for Floating-Point and Fixed-Point Types Using cast and zeros
Accelerate Fixed-Point Simulation
Double to Fixed-Point Conversion
Fixed-Point to Fixed-Point Inherited Conversion
Fixed-Point Prelookup and Interpolation
Sharing Parameters in Prelookup and Interpolation Blocks
High Precision Calculations in Interpolation Block
Shared Utility Functions for Prelookup Blocks
Fixed-Point Multiword Operations In Generated Code
Fixed-Point Multiplication Helper Functions in Generated Code
Fixed-Point Optimizations Using Specified Minimum and Maximum Values
Fixed-Point Function Approximation
Fixed-Point Conversion Using Fixed-Point Tool and Derived Range Analysis
Fixed-Point Tool
Fixed-Point S-Functions: Querying Properties
Fixed-Point S-Functions: Arithmetic Shift
Fixed-Point S-Functions: Fixed-Point Source
Fixed-Point S-Functions: Data Type Propagation
Fixed-Point S-Functions: Product and Sum
How to Use HDL Optimized Normalized Reciprocal
Implement Hardware-Efficient Real Divide HDL Optimized
Implement Hardware-Efficient Complex Divide HDL Optimized
Implement Hardware-Efficient Hyperbolic Tangent
Implement HDL Optimized Modulo By Constant
Fixed-Point HDL-Optimized Minimum-Variance Distortionless-Response (MVDR) Beamformer
Hardware-Efficient Euler Rotations Using CORDIC
Simulation Data Inspector
View Data in the Simulation Data Inspector
View Logged Data
Import Data from the Workspace or a File
View Complex Data
View String Data
View Frame-Based Data
View Event-Based Data
Import Data from a CSV File into the Simulation Data Inspector
Basic File Format
Multiple Time Vectors
Signal Metadata
Import Data from a CSV File
Microsoft Excel Import, Export, and Logging Format
Basic File Format
Multiple Time Vectors
Signal Metadata
User-Defined Data Types
Complex, Multidimensional, and Bus Signals
Function-Call Signals
Simulation Parameters
Multiple Runs
Configure the Simulation Data Inspector
Logged Data Size and Location
Archive Behavior and Run Limit
Incoming Run Names and Location
Signal Metadata to Display
Signal Selection on the Inspect Pane
How Signals Are Aligned for Comparison
Colors Used to Display Comparison Results
Signal Grouping
Data to Stream from Parallel Simulations
Options for Saving and Loading Session Files
Signal Display Units
How the Simulation Data Inspector Compares Data
Signal Alignment
Synchronization
Interpolation
Tolerance Specification
Limitations
Save and Share Simulation Data Inspector Data and Views
Save and Load Simulation Data Inspector Sessions
Share Simulation Data Inspector Views
Share Simulation Data Inspector Plots
Create Simulation Data Inspector Report
Export Data to the Workspace or a File
Export Video Signal to an MP4 File
Inspect and Compare Data Programmatically
Create a Run and View the Data
Compare Two Signals in the Same Run
Compare Runs with Global Tolerance
Analyze Simulation Data Using Signal Tolerances
Limit the Size of Logged Data
Limit the Number of Runs Retained in the Simulation Data Inspector Archive
Specify a Minimum Disk Space Requirement or Maximum Size for Logged Data
View Data Only During Simulation
Reduce the Number of Data Points Logged from Simulation


๐Ÿ“œ SIMILAR VOLUMES