|
Cyrock User wrote:
> In simulink, i would want a system to do this:
>
> Example:
>
> [0 0 0 0 0 1 0]
> |
> v
> ____________
> |Subsystem |
> |__________|
> |
> v
> 6
>
> A signal of width n is a vector of all 0 with one 1. I
> want to get the get the index of the non_zero element for
> later use in a multiswitch.
>
> How can I do this?
This is a good example of something that can be done easily with MATLAB
but is non-trivial with Simulink. The best thing to do is to use an
Embedded MATLAB Function block in your Simulink model as the "Subsystem"
above.
--
Devdatt Lad
The MathWorks, Inc.
|