How do I make MATLAB automatically add closing quotation marks?

7 ビュー (過去 30 日間)
Jason
Jason 2014 年 8 月 14 日
コメント済み: Image Analyst 2014 年 8 月 18 日
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 件のコメント
Salaheddin Hosseinzadeh
Salaheddin Hosseinzadeh 2014 年 8 月 14 日
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.

サインインしてコメントする。

回答 (3 件)

Sean de Wolski
Sean de Wolski 2014 年 8 月 14 日
No.
I'd suggest contacting tech support and letting them know you'd like this functionality.
  1 件のコメント
Image Analyst
Image Analyst 2014 年 8 月 18 日
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
Star Strider 2014 年 8 月 14 日
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 2014 年 8 月 18 日
Thanks for your help, everyone!

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by