The trick to open a full bracket right away

Problem

I assume that everyone knows the problem, forget to close the bracket or just just annoy to always enter an open bracket ( [ { , and then close it again again )]} .

Therefore, this may be a question about the wall:

Is there a trick to open the open and close part of the bracket right away so you can just write in the middle? I know that this works in Notepad ++, but I prefer to write in the Matlab editor, I just don’t need to switch between windows, check parts of my code.

I think there is a simple solution, but I could not find anything on the Internet, and I suppose that this can be an interesting question not only for me!

Edit

After the publication of the service request, it becomes clear that there is no way for matlab R2016a to do this. This could be considered in future releases of matlab, so we can hope for the best.

+6
source share
2 answers

The answer is already hidden in the question, I will post it here so that the question does not remain open:

After sending a service request, it becomes clear that there is no way to do this until matlab R2016a. This could be considered in future releases of matlab, so we can hope for the best.

In addition to this, obvious workarounds are:

  • Use a different editor
  • Enter brackets when you think of them logically. This was suggested in the comments, and I also do it when I write complex formulas.

Great example from @brainkz

disp()disp([])disp([num2str()])disp([num2str(magic())])disp([num2str(magic(4))])

0
source

Just open the fantasy when you need and close them at the end. The Matlab editor helps you by emphasizing the bracket that you close.

-one
source

All Articles