Why do I receive a Java error when opening a GUIDE figure?
7 views (last 30 days)
Show older comments
MathWorks Support Team
on 20 Jan 2021
Answered: MathWorks Support Team
on 18 Feb 2021
I am trying to create a new GUIDE figure. When I run "guide" in the command window and select "GUI with Uicontrols" from the templates, I receive the following error message in the command window:
java.lang.ClassCastException: [D cannot be cast to [Ljava.lang.String;
at com.mathworks.toolbox.matlab.guide.LayoutEditor.completed(LayoutEditor.java:2244)
at com.mathworks.toolbox.matlab.guide.LayoutEditor$ReadFigureCompleted.completed(LayoutEditor.java:3089)
at com.mathworks.toolbox.matlab.guide.utils.LayoutWorker.runOnMatlabThread(LayoutWorker.java:55)
at com.mathworks.jmi.MatlabWorker$2.run(MatlabWorker.java:79)
at com.mathworks.jmi.MatlabWorker.start(MatlabWorker.java:248)
at com.mathworks.toolbox.matlab.guide.utils.LayoutWorker.start(LayoutWorker.java:70)
at com.mathworks.toolbox.matlab.guide.utils.LayoutWorker.fevalConsoleOutput(LayoutWorker.java:41)
at com.mathworks.toolbox.matlab.guide.LayoutLooper.readFigure(LayoutLooper.java:713)
at com.mathworks.toolbox.matlab.guide.LayoutEditor.openLayoutEditor(LayoutEditor.java:2026)
at com.mathworks.toolbox.matlab.guide.LayoutEditor.openLayoutEditor(LayoutEditor.java:1989)
Additionally, I receive the following pop-up error starting with "Error using flip Too many input arguments":

How do I fix this issue?
Accepted Answer
MathWorks Support Team
on 20 Jan 2021
This error is occurring because the builtin MATLAB function "flip" is being shadowed by a user-defined function on the search path. To resolve the issue, first locate this user-defined function file by running "which flip" in the command window. Once the function file is located, rename the function / file to a different name that does not shadow a MATLAB builtin function. After this, the issue should be fixed.
0 Comments
More Answers (0)
See Also
Categories
Find more on Environment and Settings in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!