Clear Filters
Clear Filters

Automatically open matlab model with different enconding

2 views (last 30 days)
I have a model with some Japanese character in it. Everytime I open it, it will warn me with the error and I have to manually type "slCharacterEncoding('Shift_JIS')" in the Matlab command prompt and choose the model to open.
I have try to put the "slCharacterEncoding('Shift_JIS')" on preload function but it does not work.
Is there any automatic way to do that so that I can just open the model with no error comes out?

Answers (1)

Mabin Mariam Joseph
Mabin Mariam Joseph on 22 Aug 2017
Try saving the model in the SLX format. SLX files do not warn because they can store characters from any encoding.
Models created from R2012b onwards have the .slx extension by default. You can upgrade an MDL file to SLX file format. The file contains the same information as the MDL file and you always have a backup file as well.
Refer to the below MATLAB documentation links on how to save in the .slx file format :
https://www.mathworks.com/help/simulink/ug/saving-a-model.html#btbr7mo-1
https://www.mathworks.com/help/simulink/ug/saving-a-model.html#btbr7kx-1

Categories

Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!