How do I write data from a C-MEX S-function into a file?

I would like to write data from a C-MEX S-function into a file.

 채택된 답변

MathWorks Support Team
MathWorks Support Team 2009년 6월 27일
There is an example model and an S-function that you can download below.
You will have to compile the S-function using the following command:
mex fileout2.c
This example file will write every 10th data point to the file. A DWork vector is used to keep count of the number of data points.You should take a look at the mdlStart Callback that opens a file and then gets a pointer to the file. You should also take a look at the mdlTerminate Callback that will close the file.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Block and Blockset Authoring에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by