필터 지우기
필터 지우기

How to use fopen with Simulink and Matlab Coder in 2013A ?

조회 수: 1 (최근 30일)
Jonathan
Jonathan 2018년 11월 6일
As far as I understand, fopen, fprintf and fclose are supported for code generation from Matlab R2013A. I'm currently using that exact version and I'm having a hard time generating C code for a Simulink model where those 3 functions are used to write in a text file via a Matlab embedded function. The model is set to run in accelerator mode.
Here's the code of the function:
function fcn(arg1, arg2, arg3, arg4, arg5)
fileID = fopen('output.txt', 'a');
fprintf(fileID, '%10.1f %10.5f %10.3f %10.6f %10.3f\n', arg1, arg2, arg3, arg4, arg5);
fclose(fileID);
end
When attempting to generate, an error message mentions a failure to parse that function. What am I doing wrong? Or is this a bug of Matlab Coder?

답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

제품


릴리스

R2013a

Community Treasure Hunt

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

Start Hunting!

Translated by