在最近的MATLAB版本中,可以在%%使用之前从两行之间执行代码区域Ctrl-Enter.这样的区域称为代码单元,它允许快速的代码测试和调试.
例如
%% This is the beginning of the 1st cell
a = 5;
%% This is the end of the 1st cell and beginning of the 2nd cell
% This is just a comment
b = 6;
%% This is the end of the 2nd cell
Run Code Online (Sandbox Code Playgroud)
有没有支持类似功能的python编辑器?
编辑:我刚刚发现Spyderlib支持用F9支持"阻塞"执行(用空行分隔的代码区域),但是正如这个帖子所提到的,这个特性仍然不是很强大(特别是与循环结合).