Effacer les filtres
Effacer les filtres

How to load an object of class 'sym' in a .mat file

3 vues (au cours des 30 derniers jours)
Efe Berkay Yitim
Efe Berkay Yitim le 6 Sep 2023
Hello,
I have a .mat file which contains objects of class 'sym'. When I try to open this .mat file, MATLAB 2023a gives me the following error:
Warning: Cannot load an object of class 'sym': Its class cannot be found.
Warning: Some variables failed to load, and have been replaced with empty arrays. This might have happened if their classes do not exist on the path.
What should I do in this case to open this .mat file?

Réponses (1)

Steven Lord
Steven Lord le 6 Sep 2023
Do you have Symbolic Math Toolbox installed? If you don't, you won't be able to load sym objects created with the sym or syms functions from that toolbox.
  5 commentaires
Dyuman Joshi
Dyuman Joshi le 6 Sep 2023
Thanks for the info, @Steven Lord
Walter Roberson
Walter Roberson le 6 Sep 2023
The Symbolic Toolbox computations are performed in a separate process by the Symbolic Engine (symengine). Management of that complete separate process would be needed in order to support compiling the Symbolic Toolbox facilities.
At the moment I do not know of any technical reason why it could not be done, even if it would be a bit clumsy to do it (for example it might mean that every MCR had to include a copy of the engine executable). There are sometimes things that are not especially convenient to do but are not especially "hard" to do.
I have long suspected that there might be licensing reasons involved. Mathworks bought the MuPAD symbolic engine from a company, but that also means that they own the technical rights, so I don't think that it is a limit imposed by an outside company.
However... it could plausibly have to do with the fact that the symbolic engine is a complete programming language, and the input to it is effectively "data" as far as MATLAB is concerned, so if the engine could be compiled, then a sufficiently determined person could create a user interface that allowed a .exe to make general user-specific computations (by routing them through the symbolic engine.) Mathworks is not fond of that possibility, I know.

Connectez-vous pour commenter.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by