Functions not found in compiled GUI
2 次查看(过去 30 天)
显示 更早的评论
I have an issue with calling functions using eval in a compiled GUI. I get the error:
Error using eval
Undefined function 'downsample' for input arguments of type 'double'.
The code runs just fine on my computer, and I have previously compiled the same code without issue. The line appears in a function that is only called by a user input and does not call up any other functions in the GUI. I made a small change to completely unrelated code and now this line doesn't work. I previously used "decimate" in place of downsample and that stopped working on a new version after compiling (again, without changes to that section of code), and I found that changing it to downsample worked.
The code is as follows:
eval([ nam '=downsample(double(' list{e} '),double(Sample_rate/rr));']); % decimate the data down to the reduced rate from the full rate
Any guidance would be greatly appreciated.
0 个评论
回答(1 个)
Steven Lord
2015-9-8
In general, I recommend against using EVAL. See the second problem on this documentation page. I STRONGLY recommend NOT creating variables with dynamic names like that; the first question in the Programming section of the FAQ offers alternatives that will work more robustly and potentially more quickly; avoiding the EVAL should also make that call to DOWNSAMPLE "visible" to the code analysis the Compiler needs to perform to determine what should be included in the application.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!