Clear Filters
Clear Filters

Undefined function or variable

10 views (last 30 days)
Thao Ha
Thao Ha on 4 Dec 2017
Commented: Thao Ha on 5 Dec 2017
When I tried to run the file "project.m" in the folder "C:\Users\MyName\Documents\MATLAB", it always showed the error "Undefined function or variable 'project'" even though I already set PATH for MATLAB to point to that MATLAB folder. I have a student license lasting till Oct 31, 2018
  19 Comments
KL
KL on 5 Dec 2017
What happens if you close matlab and double-click open your m-file from your file explorer. That should open the file with its corresponding folder as working directory.
Thao Ha
Thao Ha on 5 Dec 2017
It still shows:
project 'project' is not found in the current folder or on the MATLAB path, but exists in: C:\DATA\WSU-Thao\Fall 2017\MATLAB
Change the MATLAB current folder or add its folder to the MATLAB path.

Sign in to comment.

Answers (2)

KL
KL on 4 Dec 2017
You still haven't answered how you set the path. Use addpath,
addpath('C:\Users\MyName\Documents\MATLAB')
  1 Comment
Thao Ha
Thao Ha on 4 Dec 2017
Edited: Thao Ha on 4 Dec 2017
I set matlab PATH by clicking on the "Set Path" icon on toolbar. I have followed your instruction to use addpath command but it did not help. The error still remains.

Sign in to comment.


Walter Roberson
Walter Roberson on 5 Dec 2017
You need to contact Mathworks for installation support.

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!