matlab - Undefined variable "modem" or class "modem.pskmod" when calling from java -


i have written code in matlab modulate , demodulate signals. deploy them using deploytool , .jar works in 1 application without gui gives me undefined variable "modem" or class "modem.pskmod". in application gui.

basically, want know cause error occur have around, don't find documentation on error.

as don't understand why work in 1 application fails in when code use similar when calling method.

ok, after testing , comparing difference between application without gui , application gui. found solution problem.

as application without gui run init method start of application (there 1 thread)
import matlabfunction.*;
public static void main(string[] args) {
matlabfunction test = new matlabfunction(); test.runfunction(1, lstabc.toarray());
}

but in code gui run init method within jframe (main() contain init code) inside edt

public static void main(string[] args) { swingutilities.invokelater(new runnable() {

        public void run() {             try {                  new main();             } catch (exception p) {             }         }     }); }   

error occur above way init matlab method. if change way of calling init method below, error solve.

public static void main(string[] args) { swingutilities.invokelater(new runnable() {

        public void run() {             try {                 matlabfunction test = new matlabfunction();                 new main(test);             } catch (exception p) {             }         }     }); }  

so, believe reason problem not calling init method "first" thread starts application.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -