Cannot open old operational simulink program

34 vues (au cours des 30 derniers jours)
Yong Zhou
Yong Zhou le 21 Nov 2024 à 0:51
Commenté : Walter Roberson il y a environ 16 heures
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 commentaires
Walter Roberson
Walter Roberson le 21 Nov 2024 à 2:22
Is it possible for you to attach the slx for testing?
John D'Errico
John D'Errico le 21 Nov 2024 à 2:25
Modifié(e) : John D'Errico le 21 Nov 2024 à 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?

Connectez-vous pour commenter.

Réponses (1)

Suraj Kumar
Suraj Kumar le 21 Nov 2024 à 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 commentaires
Yong Zhou
Yong Zhou il y a environ 17 heures
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

Connectez-vous pour commenter.

Catégories

En savoir plus sur Environment and Settings dans Help Center et File Exchange

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by