Using Matlab to import another .m file

后端 未结 3 1705
长情又很酷
长情又很酷 2021-02-19 01:02

I\'m quite new to Matlab. I\'ve defined a function inside a .m file, I want to use that function in that .m file inside another .m file, and I want to run the contents of that l

3条回答
  •  粉色の甜心
    2021-02-19 01:30

    For anyone else searching for this question, as I did, just type:

    addpath('[Path name of mat file]');
    

    This will tell Matlab how to find the function. To verify, just type:

    which [function name]
    

    If successful, it should list the path name that you just added.

提交回复
热议问题