MATLAB Answers

IKJOO
0

Error : Undefined variable "uiscopes" or class "uiscopes.​getDefault​Position" - standalone application

Asked by IKJOO
on 1 Sep 2014
Latest activity Commented on by Walter Roberson
on 20 Jan 2019
Currently, I'm building a stand-alone Windows application using Matlab Compiler. While the GUI matlab code runs perfectly within Matlab, the compiled stand-alone application doesn't work and gives an error - Undefined variable "uiscopes" or class "uiscopes.getDefaultPosition".
In my Matlab code, I create a Spectrogram scope window using dsp.SpectrumAnalyzer. Without dsp.SpectrumAnalyzer, the stand-alone application is executed well without any problem although there is no spectrogram scope window.
My matlab version is 2014a. How can I run the stand-alone application without the error?

  0 Comments

Sign in to comment.

2 Answers

Answer by Titus Edelhofer on 1 Sep 2014
Edited by Titus Edelhofer on 1 Sep 2014
 Accepted Answer

Hi,
on the page product support of compiler you see what functionality is supported. I unterstand that the SpectrumAnalyzer falls into the category "Apps and UIs". Sorry ...
Titus

  0 Comments

Sign in to comment.


Answer by Sergei P. on 20 Jan 2019
Edited by Sergei P. on 20 Jan 2019

MATLAB needs to issue an error during the compilation time, not during runtime, when it's too late an d the user is sitting and wondering what the hell is going on. Remember the Package button? That's when.

  3 Comments

It is not always possible for MATLAB to determine ahead of time which functions will be called . When it is able to figure things out, then it puts the list of excluded functions into the compile log.
No? Whatever functions are in the included *.m file during compilation and project build, those functions will stay during runtime and no new functions will appear. This is guaranteed. That's how MATLAB knows.
Example:
fminbnd('g(x)^2+1', 1, 2)
will probably not find g as a function being called. This is why the %#function pragma exists

Sign in to comment.