Cannot open old operational simulink program

37 次查看(过去 30 天)
Yong Zhou
Yong Zhou 2024-11-21,0:51
评论: Walter Roberson 2024-11-21,20:33
I cannot open old working simulink programs (2018) with 2021a. It said "Error using open (line 143) File 'C:\......slx' does not contain a valid Simulink model in SLX format: Content types stream does not exist". I also cannot open old working .m file instead of a small square.
  2 个评论
Walter Roberson
Walter Roberson 2024-11-21,2:22
Is it possible for you to attach the slx for testing?
John D'Errico
John D'Errico 2024-11-21,2:25
编辑:John D'Errico 2024-11-21,2:38
If you cannot open the old m-file also, this makes it likely something is corrupt, as an m-file is just a text file.
Can you open the problematic m-file with some other text editor?

请先登录,再进行评论。

回答(1 个)

Suraj Kumar
Suraj Kumar 2024-11-21,2:53
I understand the issue that you are facing.The error could arise for various reasons.
Here are a few workarounds that you can try :
1. Execute the following commands in MATLAB Command Window:
restoredefaultpath
rehash toolboxcache
savepath
2. Check the location of the temp directory after typing the 'tempdir' command on your MATLAB command prompt:
tempdir
Ensure the path of the temp directory you get after typing the command is local on your machine.And clean your temp directory if it is full and then try to run your model.
3.Performing a clean reinstalling of MATLAB might also help.You can refer to the following link for the steps to re-install:
Hope this helps!
  2 个评论
Yong Zhou
Yong Zhou 2024-11-21,19:12
First of all, thank you all for your help and suggestion that I really appreciated. For your suggestions, my answers are,
  1. Sorry I cannot upload the .slx file because it is work related;
  2. Tried Notepad but it's empty. In addition, the corrupted theory is scaring because we simply leaving programs there for some time or copying over to network;
  3. Tried estoredefaultpath and rehash toolboxcache but savepath gave error message as
Warning: Unable to save path to file 'C:\Program Files\MATLAB\R2021a\toolbox\local\pathdef.m'. You can save your path to a different location by calling SAVEPATH with an input argument that specifies the full path. For
MATLAB to use that path in future sessions, save the path to 'pathdef.m' in your MATLAB startup folder. In savepath (line 214)
Typed tempdir command to gave 'C:\Users\zhouyo\AppData\Local\Temp\' but could not find AppData folder there;
Then tried to open .m and .slx file but with the same error message.
4. Tried logout Simulink and restart/retype all commands but the same error message;
5. Went to original computer where the simulink programs copied from but could not open .m, .slx file as well. The error message is different as 'Error using eval Undefined function 'workspacefunc' for input arguments of the type 'struct'. This is really scaring with the same computer but could not start or even open the simulink programs;
6. At command window, even type ver given the same error message of (5).
Thanks,
Yong

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Environment and Settings 的更多信息

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by