Error: A part name shall not have a forward slash as a last character [M1.5]

68 views (last 30 days)
Hi I get the following error trying to open an slx file:
Error using open (line 163) File 'H\:My Documents\MATLAB\Fil2\FIL2.slx' does not contain a valid Simulink model in SLX format: A part name shall not have a forward slash as a last character [M1.5]
What has happened to it, and how can I fix it?

Accepted Answer

Jon Boerner
Jon Boerner on 13 Oct 2014
To start, SLX files are just ZIP files with a particular set of files and using a particular compression method.
Looking around the internet for this error, it looks like the only way to recreate the error is to manually edit the files in the SLX/ZIP file. For example, I can reproduce it with:
- Create a model (with SLX extenstion), called 'mymodel.slx' - Make a copy of the model, called 'copy_of_mymodel.slx' - Rename both files to have a '.zip' extension (i.e. mymodel.zip) - In the MATLAB file browser, copy a file from 'mymodel.zip' to the same location in 'copy_of_my_model.zip' and overwrite it - Now if I change the extensions back and try to open the copy, I get the error
After poking around a bit, I think that the reason this causes an error is that it has a strange effect on how the ZIP file is organized.
For me, I could work around the issue with the following steps:
1. For the corrupted model in question, change the file extension to '.zip'
2. In the MATLAB folder browser, right-click the file and choose "Extract". This should make a folder.
3. Open WinZip
4. Drag the contents of the folder into WinZip (don't drag the folder itself or the ZIP file will be wrong. Just drag the contents)
5. WinZip will open a pop-up. Select the option to choose your own compression method, and choose SuperFast.
6. For the destination, pick whatever you want, just have it end with an slx extension
This looked like it resolved the issue for me. I am not sure if it would be the same for you, since I don't know what caused the issue in the first place, but probably worth a shot.
  3 Comments
Mikael Sahlin
Mikael Sahlin on 15 Oct 2014
Thank you sir! I'm very thankful. You might just have saved my thesis and 3 months work!
Jon Boerner
Jon Boerner on 15 Oct 2014
Glad to hear it worked! Just a suggestion, but you might want to look into some source control as a precautionary measure moving forward. There is something called Simulink Projects that integrates GIT or SVN right into the MATLAB IDE and is built for use with Simulink.

Sign in to comment.

More Answers (0)

Categories

Find more on Interactive Model Editing in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!