How do I make MATLAB automatically add closing quotation marks?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaire
Salaheddin Hosseinzadeh
le 14 Août 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.
Réponses (3)
Sean de Wolski
le 14 Août 2014
No.
I'd suggest contacting tech support and letting them know you'd like this functionality.
1 commentaire
Image Analyst
le 18 Août 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.
Star Strider
le 14 Août 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.
0 commentaires
Voir également
Catégories
En savoir plus sur Startup and Shutdown dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!