matlab - How to find the frist occurrence of Nan value in a matlab code (m file)?
问题描述
I have a Matlab code (m-file) that contains many matrices and vectors. I'm doing some calculations and iterative solution. Of course some matrices depend on others, however, doing iterative calculation making it difficult for me to identify which which matrix has the first occurrence of a Nan value.
Is there any command or debugger that I can include at the top of my code to till me when exactly the first NaN value is generated?
(by when I mean at which step). or something that can stop my code once the first value of NaN is generated and probably help to find the related matrix/vector.
I have been searching the internet for possible solutions, however, all what I found, if I have know matrix, then I can find the index of the first NaN, but this is not my question. Related issues here and here, aside from many on Mathwork.
解决方案
推荐阅读
- perl - 命令输出中的两行到一行,我可以冻结 FH 吗?
- typescript - 是否可以在 Typescript 中构造一个允许对象但不允许错误的类型?
- express - NextJS:如何在根处理多个动态路由
- c# - Windows 是否缓存程序集使用的 .NET 版本?
- r - 有没有办法在 R 中逐月查找相同的值?
- haskell - Haskell 中 TUI 的无限循环和中断
- bluetooth-lowenergy - 外设如何在蓝牙连接中获取中央设备名称
- android - 哪种类型的连接允许服务器将数据发送到客户端而无需客户端先询问?
- r - 如何按组进行配对t检验并保存结果?
- javascript - 如何从 WebAssembly 模块中检测浏览器信息?