Cannot open old operational simulink program

38 views (last 30 days)
Yong Zhou
Yong Zhou on 21 Nov 2024 at 0:51
Commented: Walter Roberson on 21 Nov 2024 at 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 Comments
Walter Roberson
Walter Roberson on 21 Nov 2024 at 2:22
Is it possible for you to attach the slx for testing?
John D'Errico
John D'Errico on 21 Nov 2024 at 2:25
Edited: John D'Errico on 21 Nov 2024 at 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?

Sign in to comment.

Answers (1)

Suraj Kumar
Suraj Kumar on 21 Nov 2024 at 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 Comments
Yong Zhou
Yong Zhou on 21 Nov 2024 at 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

Sign in to comment.

Categories

Find more on Environment and Settings in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

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

Start Hunting!