matlab 行 读取文件 跳过_Matlab调试:跳过下一行而不执行

在Matlab中,作者寻找一种方法在调试时跳过特定代码行。现有的db*函数不提供此功能。文章讨论了可能的解决方案,包括使用eval函数结合工作空间变量来决定是否执行某行代码,但这种方法对于包含if/while结构的复杂脚本可能较为复杂。
摘要由CSDN通过智能技术生成

Questions:

(full description of problem is below)

Does anyone have a suggestion on how to trick Matlab into skipping a line or several lines of code? (mex / java / rewriting some internal Matlab features?)

Does anyone know where db* code files may be located (if exist)?

There are several functions in Matlab that allow flow-control while debugging / running a program: dbstop, dbcont, dbstep, etc... I was trying to find a db* function that would skip the next line in a Matlab script, dbskip perhaps, but sadly there is no such builtin functionality and it doesn't seem like this feature going to be ever implemented (10 years and counting).

EDIT example of use:

The following script, myScript, may call a function myFunc which decides on whether to skip the next line in the caller script based on the value of its input, like so:

% myScript.m

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值