Simulink "Find block" HDL Coder
이전 댓글 표시
How can I use HDL compatible blocks to portray the "find block" functionality. http://uk.mathworks.com/help/simulink/slref/find.html#bsdkmvh-8
Unfortunately the find block is not HDL compatible, so there must be other ways to output an index based on a condition. I have the Matlab code:
idx = find(gs >= g, 1, 'last')
that I need to simulate in Simulink with HDL coder and I don't think a user defined function block will work as it will just contain find() which is not HDL compatible. Thanks for your help in advance.
채택된 답변
추가 답변 (1개)
Bharath Venkataraman
2016년 9월 17일
0 개 추천
Assuming that gs and g are two vectors that are streaming in, you can compare each value of gs to g with the relational operator block and if gs is >= g, store the index into a register. Keep the index updated for each value of gs and g coming in, so that you always have an updated index stored in a register. Since you always update the register, when gs and g are done streaming in, you will have the last value of gs >= g.
댓글 수: 1
카테고리
도움말 센터 및 File Exchange에서 Speed Optimization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!