Apostrophes in Cell

4 次查看(过去 30 天)
Sam Falzone
Sam Falzone 2011-4-6
How do I save a string to a cell that is in apostrophes?
ie. 'filename', not filename

回答(2 个)

Jan
Jan 2011-4-6
If '''filename''' looks too confusing, e.g. when posting code in a forum:
quote = char(39);
abc = {[quote, 'filename', quote]}

Matt Fig
Matt Fig 2011-4-6
Use a double apostrophe everywhere you want one.
  1 个评论
Walter Roberson
Walter Roberson 2011-4-6
Right. So in order to use that string itself, you would use
abc = '''filename''';

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 File Operations 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by