Why does the Create Diagonal Matrix block produce incorrect results with complex data types in DSP Blockset 5.0 (R13) and later versions?

1 view (last 30 days)
I obtain incorrect results from the Create Diagonal Matrix block with complex data types in DSP Blockset 5.0 (R13) and later versions.
If I provide the following input vector to the Create Diagonal Matrix block:
[3; 2; 4]
I receive the correct output matrix and all of the elements off the diagonal are equal to zero. However, if I use a complex number for the first element like so:
[3i; 2; 4]
the output matrix contains non-zero values for elements off the diagonal.
Is the expected behavior?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
We have verified that there is a bug in DSP Blockset 5.0 (R13) and later versions in the way that the Create Diagonal Matrix block handles complex inputs.
To work around this issue, use the MATLAB Fcn block with the MATLAB DIAG function.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!