Can I make MATLAB ignore a section of code in automatic indentation?

I like MATLAB smart indentation. Ctrl-A, Ctrl-I works with me. However, in my 3000-line script, I have one section of about 100 lines of code that I would not want to touch MATLAB.

(Why are you asking? Why:

x = ... aaaaaaaaaaaaaaaaa ... - ... ( ... bbbbbbbbbbbbbb ... + ... cccccccccccccccccccccc ... ); 

What is my coding method, what is the difference in two things, one of which is aaaaaaaaaaaaaaaaa , and the other is brackets, ... etc.

So, how can I teach MATLAB not to undo this part?

+6
source share
1 answer

You can use %{ and %} to block comments:

 a = 3; b = 5; %{ some other code to be ignored %} 

and if you want to enable this inclusion, all you need is another % in the right place:

 a = 3; b = 5; %%{ some other code to be ignored %} 
+5
source

Source: https://habr.com/ru/post/1014645/


All Articles