Apostrophes in Cell

How do I save a string to a cell that is in apostrophes?
ie. 'filename', not filename

回答 (2 件)

Jan
Jan 2011 年 4 月 6 日

1 投票

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 日

0 投票

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''';

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

カテゴリ

ヘルプ センター および File ExchangeData Type Conversion についてさらに検索

製品

質問済み:

2011 年 4 月 6 日

Community Treasure Hunt

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

Start Hunting!

Translated by