C code to S function tutorials
조회 수: 4 (최근 30일)
이전 댓글 표시
Hi does anyone have any good tutorial examples that i can use to get to grips with using the legacy code toolbox ?
I have some C code and I want to learn effective ways to to turn it into S code to put in my simulink model. This model will eventually be working on a real time machine.
I have been told that the legacy code tool box is my best candidate. Does anyone have any informative tutorials that might help ?
댓글 수: 0
채택된 답변
Suneesh
2014년 1월 20일
편집: Suneesh
2014년 1월 20일
There are several examples in Simulink documentation for the legacy code tool. Look under "Custom Blocks with S-functions, System Objects and Legacy Code Tool" in:
Do consider the S-Functions mentioned in Bruno's answer as well and choose the solution which seems more suitable for you.
댓글 수: 0
추가 답변 (2개)
Bruno Pop-Stefanov
2014년 1월 20일
편집: Bruno Pop-Stefanov
2014년 1월 20일
You can call a binary from a Simulink model using MEX files. A MEX file is a binary compiled from C, C++ or Fortran code that is properly formatted to work with MATLAB code. Here is a short introduction:
and here is good starting point in the MATLAB documentation:
댓글 수: 0
Paul
2014년 1월 22일
댓글 수: 1
Kaustubha Govind
2014년 3월 25일
As the documentation states, you also need to run legacy_code('sfcn_tlc_generate', def) in order to generate the ex_sfun_doubleit.tlc file.
참고 항목
카테고리
Help Center 및 File Exchange에서 Manual Performance Optimization에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!