Can I perform circular rotation of a vector using Simulink 7.2 (R2008b)?

5 views (last 30 days)
I would like to use a built-in Simulink block to rotate a vector in a circular fashion by a specified amount. Specifically, the block should accept a vector input and allow me to specify the amount of rotation as a dialog parameter. For example, if I input the vector [5 6 7 8] and specify the amount of rotation as two, the block outputs the vector [7 8 5 6].

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
The ability to perform an arbitrary circular rotation of vectors is supported in Simulink by use of CIRCSHIFT command within Embedded MATLAB block from Simulink 7.2 (R2008b) onwards .
Please see the attached model 'vec_rot_9bpre.mdl' below to see how the functionality can be achieved.
If you have a version previous to R2008b, you may choose to write your own S-Function, or MATLAB Function block to implement an algorithm that rotates vectors by a specified amount. Or create a masked subsystem whose mask parameters control the dialog parameters of an underlying Selector block.

More Answers (0)

Categories

Find more on Modeling in Help Center and File Exchange

Tags

Products


Release

R2009a

Community Treasure Hunt

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

Start Hunting!