在编辑器中显示中文字符没有任何问题,在命令行中输入中文字符串命令也没问题,但是在运行时所有字符串就会出问题,甚至Ctrl+Enter单独运行节或者F9运行的时候都没问题,这时添加一条feature(‘DefaultCharacterSet’,‘UTF-8’)到locale文件夹中的startup.m中可解决。
来源:How do I get my MATLAB editor to read UTF-8 characters? UTF-8 characters in blank squares in editors, but in the command window and workspace works fine.
原创在这里《修改MATLAB的默认编码方式为UTF-8》, (https://blog.csdn.net/happyangry/article/details/86237693?utm_source=app)