How to solve Error:Unexpected MATLAB expression. workspacefunc 287
2 views (last 30 days)
Show older comments
When I double click the variable in workspace, the error dialog box comes up, indicates
readonly
Error: Unexpected MATLAB expression. workspacefunc 287
And also the followings show in the command window:
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: [D cannot be cast to [Z
at com.mathworks.mlwidgets.array.ValuePanel$ROML.matlabEvent(ValuePanel.java:251)
at com.mathworks.jmi.MatlabMCR$AWTReplyEvent.run(MatlabMCR.java:1636)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.WaitDispatchSupport$2.run(Unknown Source)
at java.awt.WaitDispatchSupport$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(Unknown Source)
at java.awt.Dialog.show(Unknown Source)
at com.mathworks.mwswing.MJDialog.show(MJDialog.java:311)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.setVisible(Unknown Source)
at com.mathworks.mwswing.MJOptionPane.showOptionDialog(MJOptionPane.java:539)
at com.mathworks.mwswing.MJOptionPane.showMessageDialog(MJOptionPane.java:435)
at com.mathworks.mwswing.MJOptionPane.showMessageDialog(MJOptionPane.java:425)
at com.mathworks.mlwidgets.array.ArrayDialog$1.run(ArrayDialog.java:49)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: [D cannot be cast to [Z
at com.mathworks.mlwidgets.array.ValuePanel$ROML.matlabEvent(ValuePanel.java:251)
at com.mathworks.jmi.MatlabMCR$AWTReplyEvent.run(MatlabMCR.java:1636)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.WaitDispatchSupport$2.run(Unknown Source)
at java.awt.WaitDispatchSupport$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(Unknown Source)
at java.awt.Dialog.show(Unknown Source)
at com.mathworks.mwswing.MJDialog.show(MJDialog.java:311)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.setVisible(Unknown Source)
at com.mathworks.mwswing.MJOptionPane.showOptionDialog(MJOptionPane.java:539)
at com.mathworks.mwswing.MJOptionPane.showMessageDialog(MJOptionPane.java:435)
at com.mathworks.mwswing.MJOptionPane.showMessageDialog(MJOptionPane.java:425)
at com.mathworks.mlwidgets.array.ArrayDialog$1.run(ArrayDialog.java:49)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.WaitDispatchSupport$2.run(Unknown Source)
at java.awt.WaitDispatchSupport$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.WaitDispatchSupport.enter(Unknown Source)
at java.awt.Dialog.show(Unknown Source)
at com.mathworks.mwswing.MJDialog.show(MJDialog.java:311)
at java.awt.Component.show(Unknown Source)
at java.awt.Component.setVisible(Unknown Source)
at java.awt.Window.setVisible(Unknown Source)
at java.awt.Dialog.setVisible(Unknown Source)
at com.mathworks.mwswing.MJOptionPane.showOptionDialog(MJOptionPane.java:539)
at com.mathworks.mwswing.MJOptionPane.showMessageDialog(MJOptionPane.java:435)
at com.mathworks.mwswing.MJOptionPane.showMessageDialog(MJOptionPane.java:425)
at com.mathworks.mlwidgets.array.ArrayDialog$1.run(ArrayDialog.java:49)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$200(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
0 Comments
Answers (2)
Cindy Solomon
on 6 May 2015
Edited: Cindy Solomon
on 6 May 2015
Hi Nan,
Do you have any user-defined functions called builtin, strjoin, or strsplit? MATLAB has these defined internally, and having any outside functions that shadow these built-in ones would result in this error. If you are unsure if you have created such functions, typing the command:
>> which functionName -all
will show you the path to all items on the MATLAB path with the name "functionName"
Hope this helps!
Cindy
6 Comments
Anil Thota
on 1 May 2017
One of the third party plugin has strjoin function. Unloading the plugin using your suggestion solved the problem. Thanks
RAJASHEKAR MAIDA
on 15 Dec 2015
Hi ,
I had the same problem while using simulink .As I removed them now I have encountered with a new problem .
Previously accessible file "C:\Program Files\MATLAB\R2015a\toolbox\matlab\strfun\strread.m" is now inaccessible.
Error in javaclasspath>local_get_static_path (line 318) p = strread(sp,'%s','delimiter',pathsep);
Error in javaclasspath>local_javapath (line 169) pathout = local_get_static_path;
Error in javaclasspath (line 81) p = local_javapath(a);
Error in javaclasspath>local_javapath (line 174) sp = javaclasspath('-static');
Error in javaclasspath (line 81) p = local_javapath(a);
Error in connector.internal.initClassLoader (line 4)
Error in connectorHandler (line 25)
Error in connector (line 10) connectorHandler(action, varargin{:});
Error in connector.internal.autostart.run (line 10)
Can we recover those removed folders ?
1 Comment
Jan
on 30 Oct 2017
Edited: Jan
on 30 Oct 2017
This is an old thread, but for all readers:
You have removed what? The files from Matlab's toolbox?! If so, restore them. Never remove a function from Matlab's toolboxes, but the user-defined versions, which shadow the original functions.
Can we recover those removed folders?
Either recover them from the location where you have moved them to (you did not delete them, did you?). Or from the backup (you do have a backup, don't you?). Or use the "previous versions" under Windows (you do have enabled this, don't you?).
See Also
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!