matlab 中stack是什么意思,请教一下大家,Matlab的dbstack这个函数如何使用

dbstack displays the line numbers and M-file names of the function calls that led to the current breakpoint, listed in the order in which they were executed. The line number of the most recently executed function call (at which the current breakpoint occurred) is listed first, followed by its calling function, which is followed by its calling function, and so on, until the topmost M-file function is reached. Each line number is a hyperlink you can click to go directly to that line in the Editor. The notation functionname>subfunctionname is used to describe the subfunction location.

dbstack(n) omits from the display the first n frames. This is useful when issuing a dbstack from within, say, an error handler.

dbstack('-completenames') outputs the "complete name" (the absolute file name and the entire sequence of functions that nests the function in the stack frame) of each function in the stack.

Either none, one, or both n and '-completenames' can appear. If both appear, the order is irrelevant.

[ST,I] = dbstack returns the stack trace information in an m-by-1 structure ST with the fields

file

The file in which the function appears. This field will be the empty string if there is no file.

name

Function name within the file.

line

Function line number.

The current workspace index is returned in I.

If you step past the end of an M-file, then dbstack returns a negative line number value to identify that special case. For example, if the last line to be executed is line 15, then the dbstack line number is 15 before you execute that line and -15 afterwards.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值