How to solve Error:Unexpected MATLAB expression. workspacefunc 287
4 次查看(过去 30 天)
显示 更早的评论
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 个评论
回答(2 个)
Cindy Solomon
2015-5-6
编辑:Cindy Solomon
2015-5-6
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 个评论
Anil Thota
2017-5-1
One of the third party plugin has strjoin function. Unloading the plugin using your suggestion solved the problem. Thanks
RAJASHEKAR MAIDA
2015-12-15
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 个评论
Jan
2017-10-30
编辑:Jan
2017-10-30
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?).
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!