ドキュメンテーションヘルプ センター
C Caller ブロックのグローバル変数のオブジェクト定義を取得
GlobalArg = getGlobalArg(globalVariableName)
例
GlobalArg = getGlobalArg(globalVariableName) を指定すると、FunctionArgument オブジェクトが作成されます。C Caller ブロックを使用するモデルでグローバル変数を使用するには、[コンフィギュレーション パラメーター] 、 [シミュレーション ターゲット] から [カスタム コードのグローバルを関数インターフェイスとして有効にする] 設定をオンにします。
GlobalArg
globalVariableName
FunctionArgument
すべて折りたたむ
C Caller ブロックで使用されているグローバル変数のプロパティにアクセスします。
FunctionPortSpecification オブジェクトを作成します。
FunctionPortSpecification
myFunctionPortSpecObject = get_param(gcb, 'FunctionPortSpecification')
クエリしてグローバル引数の FunctionArgument オブジェクトを作成します。
myGlobalVariable = myFunctionPortSpecObject.getGlobalArg('myGlobalVariableName')
myGlobalVariable = FunctionArgument with properties: Name: 'myGlobalVarPort' PortNumber: 1 Size: '1' Type: 'double' Label: 'myGlobalVarPort' Scope: 'Input'
グローバル変数の名前。文字ベクトルとして指定します。
データ型: char
char
C Caller ブロックに関連付けられたグローバル引数オブジェクト。FunctionArgument オブジェクトとして返されます。
C Caller | FunctionPortSpecification
次の MATLAB コマンドに対応するリンクがクリックされました。
コマンドを MATLAB コマンド ウィンドウに入力して実行してください。Web ブラウザーは MATLAB コマンドをサポートしていません。
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office