関数の中で関数を使用するには? How do I use a function in a function?

조회 수: 4 (최근 30일)
松
2024년 5월 8일
댓글: 2024년 5월 15일
写真は一例ですが,MATLAB functionの出力値を別のMATLAB functionの入力値として使用し,その出力値を元のMATLAB functionの入力値として使用したいのですが,エラーが出てしまいうまく動作しません.どのように改善すればいいのでしょうか.

채택된 답변

Akash
Akash 2024년 5월 13일
Hi 松,
Simulink cannot solve algebraic loop, if it involves blocks that cannot be assigned algebraic variables. These blocks might include those with discrete outputs, non-double or complex outputs, Stateflow blocks, or nonvirtual subsystems.
When an algebraic loop is detected, you have to leave the loop as it is or you have to eliminate it. In some scenarios, adding an 'Initial Condition' block or an 'Algebraic Constraint' block may solve the problem, though it might not be sufficient for all cases. Alternatively, introducing a small delay into the loop, using either a 'discrete delay' block or a 'memory' block, can sometimes effectively remove the loop by breaking the immediate dependency cycle.
For more information and potential solutions to algebraic loops in Simulink, you can go through the MATLAB Central discussion linked below.
  댓글 수: 1
松
2024년 5월 15일
Thank you so much. I will use it as a reference.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 トラブルシューティング에 대해 자세히 알아보기

제품


릴리스

R2021a

Community Treasure Hunt

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

Start Hunting!