Functions not found in compiled GUI

조회 수: 4 (최근 30일)
Nick Bell
Nick Bell 2015년 9월 8일
답변: Steven Lord 2015년 9월 8일
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.

답변 (1개)

Steven Lord
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.

카테고리

Help CenterFile Exchange에서 Software Development Tools에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by