Using Matlab compiler which(filename) can not locate file
11 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(2 个)
Chidvi Modala
2020-6-12
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 个评论
Steven Lord
2020-6-12
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!