matlab - 从 Matlab 上的另一个文件调用子函数(本地函数)
问题描述
我试图弄清楚如何从另一个 .m 文件中正确调用子函数。我搜索了文档,只找到了使用函数句柄的方式(可以在这里看到:https ://www.mathworks.com/help/matlab/matlab_prog/call-local-functions-using-function-handles .html )
问题是我认为我已经设法在不使用函数句柄的情况下找到了一种方法,并且想知道我在做什么以及它是如何工作的:
on main.m file:
function main
%function main...
end
function z = sub_function(x,y)
%function sub_function...
end
on outside.m file:
function call_to_local_function_from_outside
z = main('sub_function', x,y);
end
Appernalty,这是有效的,但我需要知道为什么?
解决方案
推荐阅读
- sqlite - 如何从 sqlite 选择多个输出
- apache-beam - Apache Beam SQL 中的 row_number
- sql - 有没有办法以通用方式仅更新所选值的表?
- automata - L = {a^nb^m | n,m>=1, n != 3m} 不规则?
- spring - @RestController @GetMapping 没有处理程序问题的适配器
- apache-kafka - 将kafka主题中的小消息合并到大文件一
- java - 如何将java web应用程序连接到mysql
- javascript - 在反应中显示来自json数据库的图像
- ios - 如何在 xcode 自动布局中使对象自动调整大小?
- android - 我们可以在 Flutter 项目中在 Android 设备上使用等效的 SF Symbol 吗?