How do i use vectors as input to the "interpreted Matlab Fnc" block?
2 ビュー (過去 30 日間)
古いコメントを表示
I wrote a litle test function, which determines the scalar product of two vectors. It works fine when i use it in matlab. When i use the "interpreted Matlab Fnc" block in simulink it doesnt work properly. For a = 2 and b = 1 it gives me 2, which is correct. But when i use vectors instead of numbers like a = [2;2] and b = [1;1] i get 2 instead of 4.
I tried different combinations, but its always wrong... Since the "interpreted Matlab Fnc" block has only one input-port im using a Mux-block, may this be my mistake?
Does anybody have an idea what i'm doing wrong? thx for your help
0 件のコメント
採用された回答
Azzi Abdelmalek
2013 年 4 月 30 日
a should be [2 2] instead of [2;2]
4 件のコメント
Kaustubha Govind
2013 年 5 月 9 日
Fedor: it might be a good idea to set a breakpoint in your code to understand how the inputs are passed in.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Simulink Environment Customization についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!