Can I open a file with different versions of Matlab?
조회 수: 375 (최근 30일)
이전 댓글 표시
Hello there, I have this situation: the version of matlab that is used in my university is 2012B, but I recently got the license for 2016B (I think) so I need to know if I can work with both versions over one file, since I will have to use matlab at both locations (house and university) for my assignments in class and all that stuff, Thank you !
댓글 수: 0
채택된 답변
Richard Zappulla
2017년 1월 18일
In short, Yes, but to varying levels of difficulty.
M-Files are version agnostic, though some commands may be deprecated in the newer releases.
In order to use Simulink files, you will need to be mindful of which version you are using. You can always open an older file in a newer release (i.e. R2016b will open a R2012b Simulink model), but not the other way around (i.e. R2012b will not open a R2016b Simulink model). To be backwards compatible, you will need to make sure you "export" any work done in R2016b to R2012b by going to File >> Export As >> Previous Version.
댓글 수: 2
Walter Roberson
2017년 1월 22일
"M-Files are version agnostic"
That is not actually correct. There have been a couple of changes to how objects are represented that have not been backwards compatible. In particular there was a change in roughly the R2007a time frame in object representation that would not allow any portion of the resulting .mat to be loaded in previous versions.
If I recall correctly that was considered a bug; later versions were adjusted so that incompatible items are loaded as byte arrays, so if you do save a file in R2016b and try to load it in R2012a then some parts of it might get returned as bytes but it should be able to load the other parts.
On the other hand, R2012a was before HG2, and .fig files created in R2014b or later might not be usable in R2014a or before. Mathworks does take care to write data into .fig files that is intended to usable on older versions, but I have had at least one case were it failed to load properly in older versions. You should expect potential difficulty in saving graphics objects in R2014b or later and loading them in R2014a or earlier.
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!