Calculate vector norm in Simulink?
古いコメントを表示
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!
採用された回答
その他の回答 (4 件)
DEBASISH MISHRA
2019 年 8 月 9 日
1 投票
Hi,
You may direct use matrix 1-norms from dsp tool box.
Thanks
Youssef Khmou
2013 年 4 月 8 日
0 投票
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
Steven Crews
2021 年 4 月 21 日
Agreed. This is not the correct answer.
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 月 8 日
The user defined function f(u) does not accept norm(u). From the documentation it only seems to accept the following: abs, acos, asin, atan, atan2, ceil, cos, cosh, exp, fabs, floor, hypot, ln, log, log10, pow, power, rem, sgn, sin, sinh, sqrt, tan, and tanh.
Youssef Khmou
2013 年 4 月 8 日
ok, choose the "Embeded function" instead
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.
Youssef Khmou
2013 年 4 月 9 日
yes the Fcn component...
カテゴリ
ヘルプ センター および File Exchange で Math Operations についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!