Matlab-Code-Run-for-VS-Code icon indicating copy to clipboard operation
Matlab-Code-Run-for-VS-Code copied to clipboard

[Mac OSX] Got " command 'extension.runMatlab' not found" error

Open MySadCaptain opened this issue 6 years ago • 5 comments

macOS 10.14.5 VScode 1.35.1 MATLAB R2018b

I can run matlab in terminal with command "matlab -nodesktop -nosplash -r "test"" image

And also set the matlab path in the vscode settings. image

When I use "Run Matlab File", I got error "command 'extension.runMatlab' not found". image

Any idea how to solve it?

MySadCaptain avatar Jun 14 '19 19:06 MySadCaptain

Was it in Folder mode or in File Mode ?

IamPhytan avatar Jul 03 '19 02:07 IamPhytan

Was it in Folder mode or in File Mode ?

@IamPhytan Thanks for suggestion!I tried run the command in Folder mode, it worked! It seems have to set the working directory first to make this command work. Any way to make it work also in the file mode?

MySadCaptain avatar Jul 05 '19 15:07 MySadCaptain

@MySadCaptain, if I look at the code, this extension is setting a workspace everytime it is runned, which means that it was made for folder mode.

I don't know how to discriminate between the two modes with VS Code API, but I could make a pull request that calls matlab differently if you are on Mac. It is pretty much the same procedure as my last pull requests.

IamPhytan avatar Jul 06 '19 00:07 IamPhytan

@IamPhytan Thank you! It would be great if you can make a pull request.

I did a little search and found that this post mentioned that can make a dynamic working directory by add "cwd": "${fileDirname}" in the launch.json, but it's for debug mode. Also there is a tasks.json seems can also add this configuration. I haven't figure out how to make it work.

MySadCaptain avatar Jul 06 '19 16:07 MySadCaptain

@IamPhytan I don't understand, what is a Folder Mode? (I'm new to this whole software thing). Also, @MySadCaptain, how are you running MATLAB only by using the command matlab because for me it says, 'No command matlab'.

7vik03 avatar Dec 29 '21 03:12 7vik03