Azzera filtri
Azzera filtri

How do I make MATLAB automatically add closing quotation marks?

5 visualizzazioni (ultimi 30 giorni)
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 Commento
Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh il 14 Ago 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.

Accedi per commentare.

Risposte (3)

Sean de Wolski
Sean de Wolski il 14 Ago 2014
No.
I'd suggest contacting tech support and letting them know you'd like this functionality.
  1 Commento
Image Analyst
Image Analyst il 18 Ago 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.

Accedi per commentare.


Star Strider
Star Strider il 14 Ago 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 il 18 Ago 2014
Thanks for your help, everyone!

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by