フィルターのクリア

Feedback loop using MATLAB function block in Simulink gives wrong answers

3 ビュー (過去 30 日間)
AMOL VAGAD
AMOL VAGAD 2017 年 5 月 30 日
回答済み: Abel Babu 2017 年 6 月 2 日
Hi, I am just implementing a very basic simulink function block to use a feed back loop as a test for its application in a larger project. According to the code the result should be 10 always. However I am getting -10 most of the time with some vague results initially of order 10^(-16). This is my function block code
function y = fcn(u,v)
%#codegen
y = 2*v+u;
disp(y);
This is the simulink diagram
What could be off here?

回答 (1 件)

Abel Babu
Abel Babu 2017 年 6 月 2 日
Hi Amol,
The issue that you are facing might be due to the formation of algebraic loops, i.e a direct feed through, more about the same can be read here: https://in.mathworks.com/help/simulink/ug/algebraic-loops.html
Hence, a way out of this would be to introduce a delay. If you are using continuous time, use the Transport Delay else use the Delay (Simulink/discrete)
Abel

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by