Author Topic: How to access .m files situated at a directory other than the working directory?  (Read 720 times)

Offline sam@iit

  • Newbie
  • *
  • Posts: 1
  • Matlab Forum
    • View Profile
My problem is like this -


Suppose I have a directory structure as followed-


PARENT_DIRECTORY
----- CHILD_DIRECTORY1
        ----- myfun.m [FILE]
----- CHILD_DIRECTORY2
----- mainfile.m


I have some codes written in mainfile.m situated in the PARENT_DIRECTORY which is my working directory. And it is required to call a function "myfun", which is written in myfun.m file situated in CHILD_DIRECTORY_1. How can I achieve this in MATLAB?


Thanks in advance... :)

Matlab and SimuLink Development Forum