Apostrophes in Cell
4 views (last 30 days)
Show older comments
How do I save a string to a cell that is in apostrophes?
ie. 'filename', not filename
0 Comments
Answers (2)
Jan
on 6 Apr 2011
If '''filename''' looks too confusing, e.g. when posting code in a forum:
quote = char(39);
abc = {[quote, 'filename', quote]}
0 Comments
Matt Fig
on 6 Apr 2011
Use a double apostrophe everywhere you want one.
1 Comment
Walter Roberson
on 6 Apr 2011
Right. So in order to use that string itself, you would use
abc = '''filename''';
See Also
Categories
Find more on File Operations in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!