フィルターのクリア

Use pointers in simulink

77 ビュー (過去 30 日間)
Macylia HAMIDOUCHE
Macylia HAMIDOUCHE 2022 年 8 月 17 日
回答済み: Muthukumar Ganesan 2022 年 8 月 20 日
Hello,
I would like to model on Simulink the code in C below, but as you see a pointer is used, this function modifies the value of the memory address, how can I model that, knowing that behind the goal is to regenerate a code using embedded coding?
thanks
void ModifyValue(uint16 Arg1, uint16 *Arg2)
{
{
*Arg2= 5;
}
return (void);
}

回答 (1 件)

Muthukumar Ganesan
Muthukumar Ganesan 2022 年 8 月 20 日
Hi,
You can perform this using following method.
  1. Create a Simulink function with input and output arguments
  2. Right click the block and navigate to C/C++ code --> C/C++ Function Interface
  3. Configure C/C++ Return Argument to Void, which modifies all the output arguments defined in simulink function to pointer
Please refer to this sample model if not clear
Thanks.

カテゴリ

Help Center および File ExchangeSimulink Environment Customization についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by