Open file command in Matlab DLL
2 views (last 30 days)
Show older comments
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 Comments
Accepted Answer
Ryan Livingston
on 10 Dec 2014
Edited: Ryan Livingston
on 11 Dec 2014
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.
More Answers (0)
See Also
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!