Open file command in Matlab DLL
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
JayZ
el 10 de Dic. de 2014
Comentada: JayZ
el 11 de Dic. de 2014
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 comentarios
Respuesta aceptada
Ryan Livingston
el 10 de Dic. de 2014
Editada: Ryan Livingston
el 11 de Dic. de 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.
Más respuestas (0)
Ver también
Categorías
Más información sobre MATLAB Coder en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!