Community Profile

# Andy Bartlett

Last seen: 1 dag ago Active since 2015

All

#### Content Feed

View by

Can we replace parameter value with parameter name while generating C code from model?
Please see the documentation Macro Definitions (#define) - MATLAB & Simulink (mathworks.com)

ongeveer 24 uur ago | 0

Am I missing something, or is the Tip wrong?
Hi, The advise is generally correct. Turning off Integer Saturation and allowing the math to wrap modulo 2^N will lead to lea...

3 dagen ago | 1

Why is my Simulink data type randomly changing?
Yes, this is most likely due to attribute propagation. You likely have an underspecified "chicken and egg loop" in your model. T...

9 dagen ago | 1

| accepted

What is the efficient code?
Simple Ansewer: Use shift approach unless multiplicative constant is really big In my experience, the multiply by constant foll...

9 dagen ago | 0

Method of Real number multiplication operation
Quick Answer: Shifts are Multiply or Divide by a Power of Two Shift left of M bits is equivalent to multiplication by 2^M wh...

17 dagen ago | 0

| accepted

Trouble using fixed point type conversion in Simulink
Check rounding and overflow handling mode By default, the Data Type Conversion block rounds to Floor and Wraps overflows. In c...

24 dagen ago | 0

| accepted

What is the "net slope"
Net slope is used in fixed-point operations to achieve agreement of scaling. The slopes of all the variables involved in an oper...

30 dagen ago | 0

| accepted

Simulink model converts floating-point numbers to fixed-point numbers
Suggestion consider using modByConstant Since the "denominator" of your modulos are constants, you my wish to use the modByCons...

30 dagen ago | 0

Simulink model converts floating-point numbers to fixed-point numbers
By default zeros() gives double Your output is double because of how it is initialized with the zeros() function n = 3; m = 4...

30 dagen ago | 0

| accepted

Data type conversion changes the value of the signal
Why cast to single has large quantization error. The cast from fixed-point to single will use single precision for constants an...

ongeveer 2 maanden ago | 0

| accepted

Data type conversion changes the value of the signal
Brief answer The original value 0.1 is between two representable values (0.099609375 and 0.1005859375) of the type being quanti...

ongeveer 2 maanden ago | 0

Time delay threshold for constant output
I suggest you start by writing down on paper the equations or pseudo code that you think will solve the requirements of your pro...

ongeveer 2 maanden ago | 0

Error in Divide Block - System Generator
The System Generator is a Simulink add-on product developed by AMD (Xilinx). The data types mentioned in the error message, Fix...

ongeveer 2 maanden ago | 0

| accepted

Remainder of a division operation in System Generator
Consider restructuring your design to work in units of revolutions instead of in degrees. In that case you only need to perform ...

ongeveer 2 maanden ago | 0

| accepted

Simulink Moving Average block not averaging according to the window length specified
Hi Shani, Please create a simplified model that exercises the Moving Average Block in isolation. Create a test input sequence...

2 maanden ago | 0

Floating-Point to Fixed-Point Conversion of IIR Filters
Hi, Examples often depend on supporting files. To successfully run these examples, all the files needed by the example need to ...

3 maanden ago | 0

FAQ: Why does a value look more precise when displayed in MATLAB or Simulink than in the generated code?
Textual Representation is Often an Approximation The textual representation of values displayed in MATLAB and Simulink is ofte...

3 maanden ago | 0

| accepted

Which block's fixed format will be optimized firstly in Fixed-Point tool？
Hi Lin, The optimization proceedure used by Fixed-Point Tool Optimization Conversion workflow is not designed to be determinist...

3 maanden ago | 0

| accepted

My guess is that Sum block's output data type is uint8, and the block is configured to wrap on integer overflows. So the output...

3 maanden ago | 0

n-D Lookup Table dimension error
There are two issues. For simplicity, I'll assume the block is configured to do linear interpolation and extrapolation. First,...

4 maanden ago | 1

| accepted

How to read and write to an upper half or a specific bit from a decimal number in Simulink?
Bitwise AND, OR, XOR, NOT (aka complement), shift, ... are the ways commonly used to set, clear, or otherwise manipulate bits ...

4 maanden ago | 1

| accepted

Interfacing hardware components with fixed bit width in Simulink/HDL Coder
Reinterpret Scaling Cast A technique to achieve goals like you described is to use a "Reinterpret Scaling Cast". The key idea o...

4 maanden ago | 0

| accepted

define a counter which will starts counting from zero automatically when the count reaches to 10
In a Simulink model, click on the canvas and type "counter" you'll see a list of blocks one of these is called Counter Limited...

4 maanden ago | 0

fiaccel set fi numeric type based on input
When using MATLAB Code with MATLAB Coder, MATLAB Function Block, or fiaccel, the numeric type of a variable is not allowed to ch...

4 maanden ago | 1

| accepted

INHERIT VIA BACKPROPAGATION MEANS
Inherit via Back Propagation The purpose of the setting Inherit via Back Propagation is for a block have its output data type ...

5 maanden ago | 0

| accepted

Changing significant digits of constant block
The constant block is showing the text that is entered for the parameter, and is not showing the evaluated numeric value. You do...

5 maanden ago | 2

| accepted

Why does fi signed plus unsigned produce needless range bits?
The behavior observed when adding signed and unsigned inputs is currently a limitation in Fixed-Point Designer. The sum output d...

5 maanden ago | 0

| accepted

How to create FMU source code for Linux 64 in windows with LONG_MAX set to 64 bit
Simpler need If you're goal is just to have the size of long defined as 32-bits in the generated code, then you can change the ...

5 maanden ago | 0