Are there row major or column major conversion blocks in Signal Processing Blockset?

Integrating custom matrix-based C code in Simulink can require conversion from column major data ordering, which is used in Simulink, to row major data ordering, which is used in C code. How can I convert from one format to the other within Simulink?

 Accepted Answer

The Simulink model attached to this solution illustrates the process of using a Signal Processing Blockset Transpose block to alter the data orientation, followed by a reshaping operation that preserves the shape of the original matrix. These two operations have been combined into one subsystem for convenience.
Note that performing a transpose operation will in general be slower than simply altering the row and column indices in your C code.

More Answers (0)

Categories

Find more on Get Started with Simulink in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!