为什么用sublime运行matlab时会出现混乱字符

img


如图,按照网上教程进行的操作,但没有出现预期的结果反而是一堆乱码。求指导┭┮﹏┭┮

你好,请在配之json文件时,加入encoding那一行就行,类似这种:

{
    "cmd": ["C:\\Program Files\\MATLAB\\R2020a\\bin\\matlab.exe", "${file}", "-nodesktop", "-nosplash", "-r", "${file_path}/${file_base_name}"],
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
    "selector": "source.m",
    "encoding":"cp936",
    "working_dir": "${file_path}",
    "shell":true,
    "variants":
    [
        {
            "name": "Run",
            "cmd": ["cmd", "/c", "C:\\Program Files\\MATLAB\\R2020a\\bin\\matlab.exe", "${file}", "-r", "-nodesktop", "-nosplash", "${file_base_name}"]
        }
    ]
}

里面的"encoding":"cp936",就是让你的汉字显示不乱码