i have string ['_ ,,,77 - -'''''"''"i''-_G8" ']
but it is illegal how to create it

 Réponse acceptée

Thorsten
Thorsten le 30 Avr 2015
Modifié(e) : Thorsten le 30 Avr 2015

0 votes

Use
''
for every
'
that you need in string, like:
disp('That''s not hard to understand.')
or
>> mystring = '[''_ ,,,77 - -''''''''''"''''"i''''-_G8" '']'
mystring =
['_ ,,,77 - -'''''"''"i''-_G8" ']

Plus de réponses (2)

michael scheinfeild
michael scheinfeild le 30 Avr 2015

0 votes

not works b='abc"'
b =
abc"

1 commentaire

Thorsten
Thorsten le 30 Avr 2015
Modifié(e) : Thorsten le 30 Avr 2015
' is used in Matlab to indicate the start and end of a string, but the ' are not part of the string. To get the ' as part of the string, you have to type them twice (enclosed by ' to denote a Matlab string):
b='''abc"'''

Connectez-vous pour commenter.

michael scheinfeild
michael scheinfeild le 30 Avr 2015

0 votes

but the length is ok so it may be helpful to me

Catégories

En savoir plus sur Characters and Strings dans Centre d'aide et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by