How to use variables from C-Code in a matlab function block?

조회 수: 2 (최근 30일)
rene
rene 2015년 7월 28일
댓글: Walter Roberson 2025년 4월 17일
I want to generate code from a simulink model with the embedded coder. The generated Code is used in another software project that already exists. In this software project some variables are already defined. In the simulink model, I want to use this variables in a matlab function block.
How can I tell simulink that the variable Phase_Current_U is already defined in the C-Code from the software project?
function adc1 = fcn
adc1 = Phase_Current_U;

답변 (1개)

BhaTTa
BhaTTa 2025년 4월 17일
  댓글 수: 1
Walter Roberson
Walter Roberson 2025년 4월 17일
  • MATLAB® code cannot set or access y, but external C functions can accept y as an argument.
So the value associated with the opaque value cannot be used. However, the user specifically asked to be able to use the variables in a MATLAB function block.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by