Calculate vector norm in Simulink?
조회 수: 220 (최근 30일)
이전 댓글 표시
Is there a block that finds the norm of a vector in simulink? I haven't found the equivalent to norm(v) from MATLAB.
Thanks!
댓글 수: 0
채택된 답변
Jon
2013년 4월 8일
You can use the dot product block (with the same vector wired to both inputs) followed by a square root. Both are under the Math Operations library. I think the previously suggested abs block computes the absolute values of each element of the input vector.
댓글 수: 0
추가 답변 (4개)
Youssef Khmou
2013년 4월 8일
hi, it does exist, its called "abs" , open Simulink library and go to :"Math operations" block , its the first on the list, with notation u : ABS
댓글 수: 2
Jon
2013년 4월 8일
As noted in my alternative answer, I don't this this gives you what you want. As far as I can tell abs gives the element wise absolute values, not the norm
Youssef Khmou
2013년 4월 8일
hi, if the first answer does not work, you can use other ways, like :
1) go to " User Defined Functions" in Simulink Block .
2) choose "f(u)" FCN, add it to your file , right click on it you will find the default value :
sin(u(1)*exp(2.3*(-u(2))))
change it to
"norm(u)"
댓글 수: 4
Jon
2013년 4월 9일
I couldn't find and "Embeded function" Do you mean the Interpreted MATLAB Fcn under User Defined Functions? The Interpreted MATLAB Fcn works, but I would guess that the dot product block, followed by the sqrt block is faster, because it doesn't need to be interpreted.
참고 항목
카테고리
Help Center 및 File Exchange에서 Math Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!