フィルターのクリア

Fcn convert to Matlab Function in Simulink

17 ビュー (過去 30 日間)
Sule Soylu
Sule Soylu 2023 年 2 月 15 日
コメント済み: Sule Soylu 2023 年 2 月 15 日
I use R2022a version of MATLAB, Simulink. However, I have to use fcn but this version doesn't have this function. I have to Matlab Function. Such as I write sqrt(3)*u(1)*u(3)/u(2) for fcn. How to write this function with Matlab Function using Simulink? Can you help me for this problem?

回答 (1 件)

Sachin
Sachin 2023 年 2 月 15 日
編集済み: Sachin 2023 年 2 月 15 日
I understand that you are trying to write function using MATLAB function using Simulink. Referring the following information might be of good help to you.
  1. First add MATLAB function block in Simulink.
  2. Then Click on MATLAB function block.
  3. Then you will see a function like this.
function y = fcn(u)
y = u;
4. Now, replace y = u ; with your equation. See below
function y = fcn(u)
y = sqrt(3)*u(1)*u(3)/u(2);
Here u is input to MATLAB function block and y is output.
For more information about MATLAB function block, refer to the following page
Regards
Sachin
  1 件のコメント
Sule Soylu
Sule Soylu 2023 年 2 月 15 日
Thanks a lot. It worked.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeSimulink Functions についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by