how to display or input the character '

13 次查看(过去 30 天)
in string, the character ' is to indicate start or end of a stri. but how to display or input the character '
example, i want to set the string variable a so that it contains a single character ' only.
how?
if it is other character, it is ok like
a = 'my name' then content of a will be the string my name.
i just want a single character ' in a .
thanks
angus

回答(2 个)

Matt J
Matt J 2012-10-9
Example:
>> 'a''b'
ans =
a'b

Greg Heath
Greg Heath 2012-10-9
>> z = ' '' '
z =
'

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by