在Matlab中检查脚本需要使用的功能 [英] Checking the functions that need to be used by a script in Matlab

查看:80
本文介绍了在Matlab中检查脚本需要使用的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一包别人写的代码.我正在运行一个脚本,该脚本调用了一些函数,又调用了更多函数,等等.我想获得不是MATLAB内置函数而是包的一部分的函数列表.

I have a package of code that's been written by someone else. I am running a script, which calls some functions, which in turn calls some more functions, etc. I would like to get the list of functions that are not MATLAB built-in functions but are a part of the package.

我尝试使用matlab.codetools.requiredFilesAndProducts('file.m'),它给了我这样的功能列表,但不是所有的功能.当我查看代码时,可以看到脚本中的函数调用了更多函数.此命令仅显示第一级"功能吗?如何获取完整列表?

I tried using matlab.codetools.requiredFilesAndProducts('file.m'), which gives me a list of such functions, but not all the functions. I can see when I look at the code that there are many more functions called by a function in the script. Does this command only show 'first-level' functions? How can I get the full list?

推荐答案

查看功能

Check out the function inmem which may help to solve this task. It displays all matlab functions that are currently in memory. Thus it lists those functions that have been recently called, i.e. that have been called since the last clear allor clear functions statement. Thus you would start with a clean workspace, execute your program, and check with inmem which functions are loaded into the cache and are not in the matlab install directory, those are the functions you are interested in.

您还可以使用命令行帮助器 disp-inmem 该脚本可用于(半)自动执行此任务.

You may also use the command-line helper disp-inmem that was scripted to (half-)automate this task.

这篇关于在Matlab中检查脚本需要使用的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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