FOR iterator subsystem in Simulink

I have a simulink model which has to do the following: In1 input would take in a vector of 3 element input (this will be time varying but for initial development/testing purposes I have used a constant [1 3 6]) and In2 is a constant matrix of 6x3 size whose value is X =
1 4 6
1 4 5
1 3 6
0 0 0
2 3 5
3 5 7
The simulink model should output the corresponding index (1 based index) of [1 3 6] in X (which should be 3).
When I simulate this model I am able to see value '3' at every loop (10 ms loop) with a scope inside the FOR subsystem. But when I
scope this output outside the FOR subsystem, it always displays '0' and never equal to '3'. I am not able understand this behavior.
Please help!

댓글 수: 1

dpb
dpb 2013년 7월 7일
italic I am not able understand this behavior.
Nor can we w/o seeing what you did...
I don't know Simulink at all, but is there not an interpolation/lookup block you could use directly w/o an explicit FOR...END loop?
If not, could write s-function and use intersect()
NB you'll need to always have an exact input match--maybe that's the problem in the simulation?

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Simulink에 대해 자세히 알아보기

제품

질문:

2013년 7월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by