Create diagonal matrix from vector in Simulink without DSP toolbox and without knowing the dimension of the vector
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hey!
I need to convert a vector signal into a diagonal matrix in Simulink. The problem is that I do not have the DSP toolbox so I cannot use the corresponding block that exists. Also, I do not know the dimension of the signal therefore I cannot use a constant block with "eye(<dimension>)" to create the diagonal matrix with the help of the identity matrix.
Do you have any idea to accomplish this?
Thanks!
Cedric
0 Commenti
Risposte (1)
Paul
il 16 Gen 2022
The easiest way, perhaps not without drawbacks, is to use an Interpreted Matlab Function block. In the dialog box make the 'Matlab function' diag, and make sure the box for 'Collapse 2-D results to 1-D' is not checked.
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!