メインコンテンツ

C/C++ コード生成

MATLAB® コードからの C コードの生成

MATLAB Coder™ アプリまたは codegen コマンドを使用して、MATLAB コードから C/C++ ソース コード、スタティック ライブラリ、ダイナミック ライブラリ、または実行可能ファイルを生成します。サポートされている関数に対してスタンドアロンの C コードおよび C++ コードを生成するには、MATLAB Coder が必要です。

コード生成をサポートする関数の一覧については、関数リスト (C/C++ コード生成) を参照してください。

トピック

  • コマンド ラインでの C コードの生成 (MATLAB Coder)

    コマンド ライン ツールを使用して、例の MATLAB 関数から C コードを生成する。

  • MATLAB Coder アプリを使用した C コードの生成 (MATLAB Coder)

    MATLAB Coder アプリを使用して、例の MATLAB 関数から C コードを生成する。

  • Specify Inputs in Code Generation from MATLAB

    When you use Signal Processing Toolbox™ functions for code generation, you must define the size and type of the function inputs. One way to do this is with the -args compilation option. The size and type of inputs must be defined because C is a statically typed language. To illustrate the need to define input size and type, consider the simplest call to xcorr requiring two input arguments. The following demonstrates the differences in the use of xcorr in MATLAB and in Code Generation from MATLAB.

  • スマートフォン展開用の行動認識 Simulink モデル (Statistics and Machine Learning Toolbox)

    スマートフォンへの展開用に準備された Simulink® の分類モデルからコードを生成します。

注目の例