如何在MATLAB中直接从另一个m文件直接调用m文件而不添加其文件夹路径 [英] How to call an m file directly from another m file in MATLAB without add its folder path

查看:1142
本文介绍了如何在MATLAB中直接从另一个m文件直接调用m文件而不添加其文件夹路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在不添加其文件夹路径的情况下从MATLAB中的另一个m文件调用一个m文件? 我不想通过添加它的文件夹

How to call an m file from another m file in MATLAB without add its folder path? I don't want to add its folder via

addpath(genpath(''))

推荐答案

所有功能可见性规则均基于文件夹".如果要具有不同的可视性,则必须将功能放置在不同的文件夹中.

All visibility rules for functions are based on Folders. If you want to have different visibilities you have to place your functions in different folders.

通常,避免重复的函数名称,而只是将所有源文件添加到搜索路径中是可行的.为了避免重复的函数名称,您可能需要看一下软件包.

Typically, avoiding duplicate function names and just adding all source files to your search path is what works. To avoid duplicate function names you may want to take a look at packages.

这篇关于如何在MATLAB中直接从另一个m文件直接调用m文件而不添加其文件夹路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆