フィルターのクリア

sym matrices get converted to struct

2 ビュー (過去 30 日間)
Vaibhav Raghavan
Vaibhav Raghavan 2017 年 8 月 19 日
コメント済み: Vaibhav Raghavan 2017 年 8 月 23 日
Hi,
I am working with symbolic expressions. After each computation, i save the resulting symbolic expression as an element in the matrix. Then I save these matrices in a .mat format, and load them later for use in another program. When I load it, the sym matrix gets automatically converted to struct class, and am unable to use this.
The warning reads,' Error occurred while trying to call loadobj on a sym object: Reference to non-existent field 's'. Class 'sym' is an unknown object class or does not have a valid 'loadobj' method. Object 'Uz43s' of this class is converted to struct'.
Here Uz43s was originally a symbolic matrix
The symbolic toolbox is installed properly. I am using MATLAB R2016a (version 9.0.0.341360) with Symbolic toolbox 7.0. I have also tried using higher versions of Matlab - R2017a with Symbolic math toolbox 7.2, and still receive this warning.

回答 (2 件)

Nate
Nate 2017 年 8 月 21 日
編集済み: Nate 2017 年 8 月 21 日
Hi Vaibhav,
What functions are you using in order to save and load your symbolic expressions? I am attempting to replicate the issue, so more information about your code would be very helpful. This is my naive attempt:
x = sym('x');
class(x)
y = sym('y');
matrix = [x y]
save( 'test.mat', 'matrix');
clear;
load( 'test.mat' );
This did not produce any errors, and it appears to reload the symbols successfully. Please let me know if you have more information.
  3 件のコメント
Nate
Nate 2017 年 8 月 22 日
Could you clarify the difference between copying the code through the hard drive vs running the code on the other computer? My understanding is that you are copying both the M file and the MAT file, and that the error only occurs when you move the MAT file from one computer to the other and then try to load it. Is that correct?
Vaibhav Raghavan
Vaibhav Raghavan 2017 年 8 月 23 日
Yes, that is right. The error occurs when I run the files on any other computer.

サインインしてコメントする。


Steven Lord
Steven Lord 2017 年 8 月 21 日
While the MATLAB session in which you created and saved the data has Symbolic Math Toolbox available, I suspect the MATLAB session in which you're trying to load the symbolic matrix does not have Symbolic Math Toolbox installed. Check with the ver function that this product is installed.
  3 件のコメント
Walter Roberson
Walter Roberson 2017 年 8 月 21 日
Please show the output of
which -all sym
on the system that the load fails on.
Vaibhav Raghavan
Vaibhav Raghavan 2017 年 8 月 22 日
C:\Program Files\MATLAB\R2016a\toolbox\symbolic\symbolic\@sym\sym.m % sym constructor

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeConversion Between Symbolic and Numeric についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by