Why do i receive an error using open (line 143) while open my simulink model?
17 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
When i try to open simulink model file appears an 'error dialog' window, which shows message:"Error using open(line 143) 'file path' is not a valid simulink model file: could not open source package". I have R2021b version, on the other computer this file opens well with the same version of matlab.

1 Commento
Risposte (1)
Walter Roberson
il 4 Set 2022
That file is not a valid Simulink model.
Simulink .slx files are internally a zip'd directory containing mostly .XML files. However, that file is not in any recognized archive format that I am able to detect.
6 Commenti
Walter Roberson
il 4 Set 2022
The .slx file is not a valid Simulink model under any encoding.
fid = fopen('testmodel.slx', 'r'); first2 = fread(fid, [1 2], 'char*1=>char'); fclose(fid); first2, dex2hex(first2)
Will output 'PK' for potentially-valid simulink models, and '50' '4B' for the hex part.
For the file you posted, the output is instead 'Ó±' and 'D3' 'B1'
This is not a matter of window-1251 versus UTF-8 . The PK is a "magic number" used to signal that what follows is (potentially) a PKZip-style zipped file, that will be internally unzipped to find the details of the model. With your file not having that at all, there is no possibility that your posted file is a valid Simulink model.
Vedere anche
Categorie
Scopri di più su Simulink Environment Customization in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!