Command "matlab.io​.saveVaria​blesToScri​pt" max memory/elements

조회 수: 4 (최근 30일)
Alessandro Vitiello
Alessandro Vitiello 2021년 2월 16일
댓글: Thomas McKay-Smith 2022년 12월 15일
Hi all, I am using the matlab command matlab.io.saveVariablesToScript In order to save my output in .m file instead of .mat (in order to save space memory in my pc).
But in some case the output is create as a .mat file plus a script that run the .mat file because :
"too many elements at str.Output.error_flag.signals.values"
But I am not able to find the thresholds over that is no longer possible save as .m file
Which is this thesholds ? What it depend on ? The dimension of data, the number of elements, both of them ?
Many thanks for your time and consideration Kind regards

답변 (1개)

Thomas McKay-Smith
Thomas McKay-Smith 2022년 12월 15일
By trial and error I have found variables are saved to a '.mat' file instead of a script when the the number of elements is >1000. For a structure this only needs to be the case for one field and the whole structure will be saved to the '.mat' file.
  댓글 수: 1
Thomas McKay-Smith
Thomas McKay-Smith 2022년 12월 15일
And I have just discovered you can change the limit up to a maximuum of 10,000.
e.g.
matlab.io.saveVariablesToScript('foo_script.m',foo,'MaximumArraySize',1e4)

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

카테고리

Help CenterFile Exchange에서 Workspace Variables and MAT-Files에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by