How to convert level 2 s block to function ?

8 ビュー (過去 30 日間)
digivjay pandey
digivjay pandey 2015 年 4 月 9 日
コメント済み: digivjay pandey 2015 年 4 月 15 日
I am trying to convert a matlab level 2 s function block into a normal function script. For that I need to understand the working of S function. Specifically, how are the differential equations being solved by Derivative call back. Is it using simulation time step as the delta-time ? what other parameters it obtains from simulation environment for these calculations. Anyone having any Idea, please help me out. Also I want my functions to be c-coder compatible, so I am unable use of 'syms' or other c-coder incompatible stuff.

採用された回答

Abhishek GS
Abhishek GS 2015 年 4 月 10 日
Hi digvijay,
Firstly, please go through this link to understand the concepts of how S-Function works in Simulink environment. Look at this link to understand the functionalities of different APIs used in MATLAB level 2 S-Functions. Type 'sfundemos' on your MATLAB Command prompt to look at a few demo examples on S-Functions that are shipped. These will help you get started in the right direction.
Only the functions mentioned in this link are supported for Code Generation.
Hope it helps, Cheers, Abhishek
  1 件のコメント
digivjay pandey
digivjay pandey 2015 年 4 月 15 日
this was most certainly helpful, what exactly I want to know is.. how is the integration being performed so that I can code it in a .m file. what is the time step being followed there and of any other functions are required there. Thanks Bro!

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

その他の回答 (0 件)

カテゴリ

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