Open file command in Matlab DLL
1 次查看(过去 30 天)
显示 更早的评论
Hi Everyone,
I am struggling with building a dll for my m-files.
In particular: In one of my functions I am passing a file path to my dll and I want to receive data back in return which is the output of my dll.
While this sounds very well in theory, it appears that whenever I try to compile the executable I receive an error message about "extrinsic functions" could not be compiled in a standalone. (this is important for me as there is no matlab installed on the later application pc - mrt engine naturally is)
I tried to re-program my code with basic file operation functions but it appears that is not allowed to create a dll which reads data from a file.
Am I missing something? Does anyone know if the file open command is possible from a matlab dll?
I would highly appreciate your input on this.
0 个评论
采纳的回答
Ryan Livingston
2014-12-10
编辑:Ryan Livingston
2014-12-11
It sounds like you are using MATLAB Coder ("extrinsic functions" makes me think so) to generate C code, is that true? If so, you should be able to use FOPEN,FREAD,FCLOSE in your MATLAB code from which you are generating code.
Code generation support for FREAD was added in R2014a and FOPEN and FCLOSE were added for code generation in R2013a:
If those are unavailable or insufficient you can see the answer:
that shows how to read in a space-delimited file of doubles in standalone code for an example of using coder.ceval to call the C runtime I/O functions.
更多回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!