Functions not found in compiled GUI
4 ビュー (過去 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 で Software Development Tools についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!