I love MATLAB "smart indenting". Ctrl-A, Ctrl-I is hardwired with me. However, in my some-3000-lines script, I have one section of about 100 lines of code which I would like not to be touched by MATLAB.
(Why, you ask? That's why:
x = ...
aaaaaaaaaaaaaaaaa ...
- ...
( ...
bbbbbbbbbbbbbb ...
+ ...
cccccccccccccccccccccc ...
);
That's my way of encoding that this is a difference of two things, one of which is aaaaaaaaaaaaaaaaa
, the other being a set of parentheses, ... etc etc.
So, how can I teach MATLAB to not re-indent this part?
You can use the %{
and %}
for comment block:
a = 3;
b = 5;
%{
some other code to be ignored
%}
and if you want to toggle this ON, all you need is one more %
in the right place:
a = 3;
b = 5;
%%{
some other code to be ignored
%}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With