shinyypig / matlab-in-vscode

A vscode extension for matlab.
MIT License
44 stars 4 forks source link

The run current matlab file function didn't work #7

Closed moolawooda closed 1 year ago

moolawooda commented 1 year ago

It seems that the "Run Current Matlab File" buttom just open a new matlab window or an interactive terminal but no .m file is running on it. The same situation appears in CMD or Pybackend mode.

In the "Matlab Code Run" extension, the command matlab -nosplash -nodesktop -sd $work_dir$ -r "run('./$script_name.m$');" is used instead of only matlab -nosplash -nodesktop to run a specific .m file.

Maybe some changes also need to be done with Pybackend mode to make it run a specific .m file.

shinyypig commented 1 year ago
image
moolawooda commented 1 year ago

The button in the menu bar didn't work for a '.m' file, After clicking, it just open a blank matlab terminal. If I reclick it, the terminal in vscode will say:'run' is not recognized as an internal or external command, operable program or batch file.and nothing happend.

shinyypig commented 1 year ago

If you are using windows:

image

You can find the link to install MATLAB Engine API for Python in README.

moolawooda commented 1 year ago

Thanks for your response, the pybackend mode do work for me. But in this mode, Chinese characters will not display in the terminal, what should I do to display Chinese?

shinyypig commented 1 year ago

In my Windows PC, Chinese characters display normally. My system OS is the newest Windows 11, and I use PowerShell as the terminal.

I'm not sure why your terminal is unable to display Chinese characters properly, but this shouldn't be an issue with this plugin.

moolawooda commented 1 year ago

The "Matlab Interactive Terminal" plugin can display Chinese characters in terminal, but this plugin do not display any Chinese characters in the terminal. I also using the newest win11 system and the default terminal is powershell.

shinyypig commented 1 year ago

The "Matlab Interactive Terminal" plugin can display Chinese characters in terminal, but this plugin do not display any Chinese characters in the terminal. I also using the newest win11 system and the default terminal is powershell.

You mean when you use disp to print some Chinese characters, it will not show in the terminal?

If it is, it is a still a issue related to matlab api for python, since this plugin only bring up a python terminal and send the code to this terminal.

moolawooda commented 1 year ago

Yes, the disp function could not display Chinese characters in python terminal. Thanks for your reply!