Using Matlab compiler which(filename) can not locate file
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
I'm compiling into an executable a matlab function that includes a which() finction:
str = which(filename)
The file is on the path and the function returns the file location successfully if I run from matlab but does not work if I compile the app into an executable.
This works in 2018B but stopped working in 2020A.
This seems to be a bug in 2020A. Any suggestions for a workaround?
Thanks!
0 comentarios
Respuestas (2)
Chidvi Modala
el 12 de Jun. de 2020
I tried generating executable for the following piece of code in MATLAB R2020A
function code()
filename = 'abc.m';
str = which(filename);
disp(str)
end
It worked fine. Can you elaborate on what error you were getting and code you were trying to run?
0 comentarios
Steven Lord
el 12 de Jun. de 2020
What are you planning on doing with that information?
If you're planning to use this to try to run a function the user provides when running the executable, this will not work.
Also, what does "stopped working" mean in this context?
- Do you receive warning and/or error messages?
- Does it do something different than what you expected? If so, what did it do and what did you expect it to do?
- Does your application crash? If so please send the crash log file (with a description of what you were running or doing in the executable when the crash occured) to Technical Support using the telephone icon in the upper-right corner of this page so we can investigate.
Ver también
Categorías
Más información sobre MATLAB Compiler en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!