MATLAB Answers

Loading simbiology models created in MATLAB 2019b in previous version of MATLAB

12 views (last 30 days)
1) Is there a way to load models created in MATLAB 2019b in previous version of MATLAB? I get the warning: Variable 'model_x' originally saved as a SimBiology.Model cannot be instantiated as an object and will be read in as a uint32.
2) Is there a way to save the model created in MATLAB 2019b as previous version, for example as a 2018b simbiology model?

  0 Comments

Sign in to comment.

Accepted Answer

Arthur Goldsipe
Arthur Goldsipe on 17 Jan 2020
In general, we cannot guarantee this kind of compatibility (which is called "forward compatibility"). In practice, SimBiology models have been largely compatible across releases. Hovwever, R2019b introduced a major change that means you cannot load models in earlier releases.
So, regarding question 1: There is no way to directly load a R2019b SimBiology model in an earlier release. You must save/export that model in some special way if you want to use it in an earlier release.
Regarding question 2: The simplest option for sharing a R2019b model in an earlier release is to export the model to SBML. However, not all features of SimBiology models are compatible with SBML. If you want to preserve more of the model across MATLAB versions, the best way is to transfer the model as "code". By that I mean you can write a script that constructs the model using the same commands you use to construct it in R2019b. If you need to do this, consider contacting MathWorks Technical Support. We have some automated tools that could help with the process.

  4 Comments

Show 1 older comment
Arthur Goldsipe
Arthur Goldsipe on 2 Apr 2020
My answer should still be accurate for R2020a. If you modify your model in R2020a and save it to a MAT file, you should be able to read that MAT file in R2019b, but not in earlier release. That said, if you are using features that are new in R2020a, you will not be able to use those features when you open the model in R2019b.
Does that answer your question? If not, can you be a little more specific about what you want to do?
Annie Crumbley
Annie Crumbley on 2 Apr 2020
Thank you for the response! I was thinking in the forward direction (2019a -> 2020a) when I responded. My model was stuck on the spinning wheel and wouldn't load, which is how I found this question.
However, I made a copy and deleted all of the data and simulation files attached to the diagram and was able to open it fairly quickly, so I think I'm good now. Thank you for the followup, though! Your answers on a number of questions have been a real help in trying to finish my thesis project amidst this pandemic disruption.
Arthur Goldsipe
Arthur Goldsipe on 2 Apr 2020
Great to hear. And good luck finishing your thesis.
You should generally be able to open old projects in new versions. If the project with data and simulations wouldn't open in R2020a, that sounds like a bug. If you can share the project with me when you get a chance, we can investigate and try to fix any bugs we find. (But I'm glad you were able to work around it.)

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Products

Communities

More Answers in the  SimBiology Community