How do I make MATLAB automatically add closing quotation marks?

10 visualizaciones (últimos 30 días)
Jason
Jason el 14 de Ag. de 2014
Comentada: Image Analyst el 18 de Ag. de 2014
When I type an opening quotation mark (or bracket), I often forget to add the closing quotation mark (or bracket). In some languages (such as R Studio), the program automatically adds the closing quote when we type the opening quote. Is it possible to do this in MATLAB (in both the script window and the command window)?
  1 comentario
Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh el 14 de Ag. de 2014
Jason it's an IDE capability.
Even if not, you may be able to download a different IDE such as CodeBlocks which I'm using for C++ and it does what you want, and it's supports several languages including MATLAB, so you can use CodeBlocks to write your code but then I don't know how you can compile your MATLAB code from CodeBlocks, I've never tried it.
Search in MATLAB preference or editor settings, maybe you find that, I've never saw such thing in MATLAB though.

Iniciar sesión para comentar.

Respuestas (3)

Sean de Wolski
Sean de Wolski el 14 de Ag. de 2014
No.
I'd suggest contacting tech support and letting them know you'd like this functionality.
  1 comentario
Image Analyst
Image Analyst el 18 de Ag. de 2014
And how is the IDE supposed to know where the quote should end? Let's say the line of code is
str = 'this is some text; % initialize the string
You could make a guess that the ' should come before semicolon but not necessarily. Maybe it was supposed to come at the end of the line. There could be a huge number of ambiguities / uncertain situations.

Iniciar sesión para comentar.


Star Strider
Star Strider el 14 de Ag. de 2014
If you look closely, in the MATLAB Editor, a red underscore will appear at the end of a line with unmatched parentheses, brackets, quotes, missing commas in an argument list, and other such errors. It won’t close the quotes for you because it can’t guess what you’re thinking (consider the transpose operator).
It might be nice if the underscore was a bit more prominent, but once you remember to look for it, it can be quite helpful in alerting you to errors.

Jason
Jason el 18 de Ag. de 2014
Thanks for your help, everyone!

Etiquetas

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by