I run the main code that needs some subcodes in specific folders that are located within the working directory. I add these folders with the following commands:
addpath('./k_means');
addpath('./pb');
The error message when the main file (in the current working directory) tries to read subcodes in the above directories.
Undefined function or variable 'demo_pb'.
What's the fix for that?
mfilename('fullpath')
to get the current folder of the currently running script. From those path create the fullpath of your two subfolder.demo_pb
function stored ? And how do you call those function ?addpath('./pb');
. 2. Beforepb_im=demo_pb(input_im);
, replace it with the command:cd('./pb');
. 3. Place a breakpoint at thecd('./pb');
line and execute code until stop at breakpoint. 4. Single step (press F10). 5. Verify the current folder ispb
and the filedemo_pb.m
is in the folder. 6. Step intodemo_pb
(press F11), and see if it works.