matlab.int​ernal.lang​.capabilit​y.Capabili​ty error when opening data in the workspace

30 vues (au cours des 30 derniers jours)
Recently, when I double-click on any vector or array in the workspace to open it to view (these are small; this is not a memory issue regarding the display of vectors or arrays), I obtain the following error:
"Error: File: C:\ProgramFiles\MATLAB\R2021b\toolbox\matlab\codetools\openvar.m Line: 97 Column: 12 Unable to find or import 'matlab.internal.lang.capability.Capability'. Imported names must end with '.*' or be fully qualified."
I am using 2021b on a Windows10 machine. I've never had this arise before. Does somebody know why this is happening?
  2 commentaires
Walter Roberson
Walter Roberson le 16 Sep 2022
Experiment with
restoredefaultpath; rehash toolboxcache
and test. If it cures the problem then you had something on your MATLAB path that is interfering.
Chris Keylock
Chris Keylock le 17 Sep 2022
Great, thanks for this solution, which solved the problem. Still a little surprised that something on the path affects this aspect of the software functionality.

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 17 Sep 2022
If you have third-party toolboxes on your MATLAB path and they are earlier on the path than the built-in folders, then you can encounter random internal problems.
One third-party toolbox that often leads to this kind of problems is SPM12, which has a couple of "legacy" folders containing implementations of Mathworks functions for use in MATLAB releases before Mathworks introduced the functions. In most cases those "legacy" folders for SPM12 should be deleted.
The third party tool dfield also had a couple of problems along these lines.
The restoredefaultpath; rehash toolboxcache solution is not a permanent solution: it would remove all third-party tools from your path until the next time you restart MATLAB, unless you use savepath or pathtool . If you no longer use the third-party tools then remove them (at least from your path); if you still use them, then you could try moving the third-party tools to the end of the path ( pathtool is very useful for this purpose.) But sometimes you end up needing to go into the third-party tool and renaming some of its files and adjusting the code, as the third-party tools sometimes rely upon their incompatible functions.

Plus de réponses (0)

Catégories

En savoir plus sur Performance and Memory dans Help Center et File Exchange

Tags

Produits


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by