matlab中level,Level-1 MATLAB S-Function和Level-2 MATLAB S-Function有何区别?
Matlab允許你使用以下五種方式之一來實現S函數:
A Level-1 M-file S-function provides a simple M interface to interact with a small portion of the S-function API. Level-2 M-file S-functions supersede Level-1 M-file S-functions.
Level 1 M文件S函數----這種方式提供了一個簡單的M文件接口,可以與少部分的S函數API交互。Matlab對于這種方式的支持更多的是為了保持與以前版本的兼容,現在推薦采用的是Level 2 M文件S函數。
A Level-2 M-file S-function provides access to a more extensive set of the S-function API and supports code generation. In most cases, use a Level-2 M-file S-function when you want to implement your S-function in M.
Level 2 M文件S函數----支持訪問更多地S函數API,支持代碼生成。當你要使用M文件來實現一個S函數的時候,選擇Level 2 M文件S函數。
A handwritten C MEX S-function provides the most programming flexibility. You can implement your algorithm as a C MEX S-function or write a wrapper S-function to call existing C, C++, or Fortran code. Writing a new S-function requires knowledge of the S-function API and, if you want to generate inlined code for the S-function, the Target Language Compiler (TLC).
手寫C MEX S函數----這種方式提供了最大的編程自由度,你可以使用C MEX S函數來實現你的算法,也可以寫一個wrapper S函數,調用已經存在的C,C++,Fortran代碼。使用這種方式編寫一個新的S函數需要對于S函數API的了解,如果你寫的S函數要產生內嵌式代碼,還需要熟悉TLC。
The S-Function Builder is a graphical user interface for programming a subset of S-function functionality. If you are new to writing C MEX S-functions, you can use the S-Function Builder to generate new S-functions or incorporate existing C or C++ code without interacting with the S-function API. The S-Function Builder can also generate TLC files for inlining your S-function during code generation with the Real-Time Workshop product.
S函數創建器----這是采用圖形用戶界面的方式實現部分S函數功能的方式。如果你對于編寫C MEX S函數不熟悉,可以使用S函數創建器來產生新的S函數,或者將已有的C,C++代碼集成到S函數中而不需要與S函數API打交道。S函數創建器可以同時生成TLC文件,這些TLC文件可以在自動代碼生成時為你的S函數生成內嵌代碼。
The Legacy Code Tool is a set of MATLAB commands that helps you create an S-function to incorporate legacy C or C++ code. Like the S-Function Builder, the Legacy Code Tool can generate a TLC file to inline your S-function during code generation. The Legacy Code Tool provides access to fewer of the methods in the S-function API than the S-Function Builder or a handwritten C MEX S-function.
舊代碼工具---是一系列的Matlab命令,這些命令幫助你集成以前的C,C++代碼以生成一個S函數。與S函數創建器一樣,舊代碼工具可以產生TLC文件,不過相比于S函數創建器和手寫的C MEX S函數,舊代碼工具只能訪問很少的S函數API。
總結
以上是生活随笔為你收集整理的matlab中level,Level-1 MATLAB S-Function和Level-2 MATLAB S-Function有何区别?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 太早
- 下一篇: matlab人脸追踪,求大神帮助我这个菜