Problem in writing TLC file for Matlab Level2 M file s function

5 ビュー (過去 30 日間)
vinothkannan K
vinothkannan K 2013 年 5 月 8 日
コメント済み: Kaustubha Govind 2014 年 6 月 6 日
Am facing issue in creating dll, for that i need to write TLC file for Level2 M file S function. I need TLC file format.... Its is possible to generate code for Level2 M file S function with out tlc file??

採用された回答

Kaustubha Govind
Kaustubha Govind 2013 年 5 月 8 日
No, you do need to write a TLC file to generate code from a MATLAB S-function. If your algorithm is simple enough to write as a function (ie. no states or initialize/terminate methods), you may want to try using the MATLAB Function block instead. As long as you're writing MATLAB code that is compatible for code-generation (read the previously linked documentation for details), you will be able to generate code from the block.
  2 件のコメント
vinothkannan K
vinothkannan K 2013 年 5 月 9 日
Thanks kaustubha for your answer., But am using Level2 s function because its taking data from GUI., It just contains output function only.... For that only i need to writ tlc file... any tlc file format is there? Am trying with different method but its not taking....
Kaustubha Govind
Kaustubha Govind 2013 年 5 月 9 日
Perhaps this discussion will help you.

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

その他の回答 (1 件)

Inibrith
Inibrith 2014 年 6 月 6 日
Hi Kaustubha,
TLC examples in Matlab Documentation are not very useful. I sometimes have the need to hook up some external components into Simulink, using java methods. I would like to have a step by step creation from Level-2 code to TLC to RTW (now Simulink coder) so that my block diagram gets compiled into an executable. The timestwo example basically tells me I have to re-write the code (as if it were really simple) for "optimization". Why such a simple example as multiplying by two needs to be optimized anyway? Like if for multiplying by two, one has first to take the integral of a Riemann series, take the square root, chopping away any complex conjugated number, then take the Lyapunov function (for whatever reason you ever need to do that) to resolve a differential equation... See the picture? Suffice to say, I don't really see any value added by a TLC file, with the example provided.
People looking at such simple (unhelpful BTW) example would raise the (very reasonable) question about: Why can't we automatically generate the TLC file? If it is the same as re-naming functions such as those exposed! Or even better... why not writing it in the first place with that language? If it is "optimized" already, everyone would like to have a faster simulation anytime.
Any useful information, step by step example, where we can hook and tell the compiler how to deal with your M code so that it gets compiled using Simulink coder, would be very much appreciated.
Best regards,
Inibrith H.
  1 件のコメント
Kaustubha Govind
Kaustubha Govind 2014 年 6 月 6 日
It is currently possible to automatically generate TLC files for C-MEX S-functions using the Legacy Code Tool and S-function Builder.
For MATLAB code, we recommend that you use either the MATLAB Function block or MATLAB System block (MATLAB code needs to be written in the form of a System object) - both blocks automatically generate C code, as long as your MATLAB code is supported for code-generation. Please see the documentation for more information on code-generation support for MATLAB.

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

カテゴリ

Help Center および File ExchangeTarget Language Compiler についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by