How to solve Error:Unexpected MATLAB expression. workspacefunc 287

조회 수: 3 (최근 30일)
Nan Wu
Nan Wu 2015년 5월 4일
댓글: FAS 2022년 4월 8일
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)

답변 (2개)

Cindy Solomon
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
Anil Thota 2017년 5월 1일
One of the third party plugin has strjoin function. Unloading the plugin using your suggestion solved the problem. Thanks
FAS
FAS 2022년 4월 8일
Yes, this is the perfect solution.

댓글을 달려면 로그인하십시오.


RAJASHEKAR MAIDA
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
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 CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by