mathworks / mathworks/MATLAB-extension-for-vscode

Matlab Does Not Run Codes on Visual Studio Code

Open
#147 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
435
Forks
40
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
I have Visual Studio Code Version: 1.89.1 with Matlab extension v1.2.2, I have Matlab R2024a.

Everything seems working but when I try to run a Matlab code in Visual Studio code, it gives me notification that "File is not found in the current folder or on the MATLAB path" after I click on "Add to Path" then I receive Unrecognized function or variable on terminal.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'my a.m file'
  2. Click on '.Run'
  3. Scroll down to 'Terminal'
  4. See error "Unrecognized function or variable a"

Expected behavior
I expected matlab code be running and generating plots and results.

Screenshots
image

Useful Information

  • OS Version: Sonoma14.5
  • VS Code Version: 1.89.1

Thank you for your help in advance.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the Run action for the reported a.m file in Visual Studio Code with MATLAB R2024a, then inspect how the extension handles the current folder and MATLAB path when launching the terminal. Done means the file runs from the Run command and produces its expected plots and results without the path or unrecognized-variable errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
matlab, typescript, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.