Using Matlab to import another .m file

后端 未结 3 1703
长情又很酷
长情又很酷 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:27

    In principle, MATLAB advocates the use of one function per .m file. You can call such a function from another .m file and from the MATLAB command line.

    You can define multiple functions in one .m file, but only the first (or 'outermost') function can be accessed from other .m files or the command line. The other functions are treated as 'helper' functions that may be called only inside this particular .m file.

提交回复
热议问题