Convert Matlab Code to MATLAB System Block in Simulink

Hi I need help to convert Matlab Code file to a MATLAB system in Simulink.
For an example the coded function below have been made in the terms of code file. However, when I try to recall the function from MATLAB System, it says it's not a system object.
function [dCadt,dTdt] = reactor1(Ca, T)
Ea=4800;
k0=1e12;
dH=5000;
U=15;
rhocp=0.2;
R=1.7;
V=70;
F=6000;
Caf=1.32;
Tf=40;
A=11;
Tj=80.9;
dCadt=((F/V)*(Caf-Ca))-(k0*Ca*exp(-Ea/(R*(T+460))));
dTdt=((F/V)*(Tf-T))-(dH)/(rhocp)*(k0*Ca*exp(-Ea/(R*(T+460)))-(U*A)/(rhocp*V)*(T-Tj));

2 件のコメント

Arunkumar M
Arunkumar M 2018 年 12 月 11 日
What is the exact error you are getting? Can you give a snapshot of that?
Is the function script in the working path?
Muhd Azizan Ismail
Muhd Azizan Ismail 2018 年 12 月 13 日
Illustrated below is the step-by-step action on what I did to convert the MATLAB Code in Step 2 into the MATLAB System shown in Step 1. However, when I try to define the system object. An error was found, displayed as in Step 3. Capture3.PNG

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

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeModeling についてさらに検索

製品

質問済み:

2018 年 12 月 10 日

コメント済み:

2018 年 12 月 13 日

Community Treasure Hunt

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

Start Hunting!

Translated by