Matlab
1、生成数据时,多重循环,最起码要把最里面的循环跑一遍,看看生成的图片,和label有没错。确定一下,然后再跑整个程序。
2、跑for循环,卡死在某一个数据上。可以把这个数据单独运行下看看结果
3、生成数据,即使成功。也要读入一两个图片,看看图片属性呀。。。
4、编写小程序时,可以先慢慢编写部分功能,整各个小功能都写好了,再整一个整体的程序,不然一开始就想把程序全部编写好,这很困难。
5、Matlab一般程序运行是很快的,所以卡半天没动。可以把循环每个都在纸上写一遍。很有可能是粘贴代码,变量都忘改,然后就直接跑了。
6、编写一个比较复杂功能的程序,可以先把整个程序要实现的功能分解为几个小步,然后拆分开来一步一步看运行的结果。如果遇到某一个功能比较复杂,可以现在纸上写好程序的伪代码,确定没有逻辑错误,然后再开始写代码,功能比较复杂的程序段,不先写好伪代码,很容易出现逻辑错误。这就很难发现这个bug。
7、向量和常数运算,要注意matlab里面的运算,带点和不带点的区别。