how characters connected in quotes

1 visualización (últimos 30 días)
Qian Li
Qian Li el 15 de Feb. de 2020
Comentada: Star Strider el 16 de Feb. de 2020
Hello,
I am complete beginer. Cannot find answers on the web, and don't know how to search the answer.
I don't know the rules of connecting the characters in the quotes. Wonder what makes a difference of the double and trible and space in the rule of connection
excute the following command
['a'' b ' '''c''']
['a'' b ' ''' c ''']
['a','b']
['a' 'b']
['a'' b ']
the answers are the following
ans =
'a' b 'c''
ans =
'a' b ' c ''
ans =
'ab'
ans =
'ab'
ans =
'a' b '
Any explanation and ways to teach me how to find the answer are all appreciated. Many thanks!

Respuesta aceptada

Star Strider
Star Strider el 15 de Feb. de 2020
See the char documentation for information on character arrays, and string for information on string arrays.
Those should provide the information you likely need, and an introduction to the online documentation.
To find that information in your own MATLAB installation, type:
doc char
doc string
in your Command Window or a script (then run the script).
  2 comentarios
Qian Li
Qian Li el 16 de Feb. de 2020
Thanks for the help! Cannot fine relevant explanation on my problem using the doc command. But asked a friend, who gave me the answer: just return '' in '...' as a singel ' in '...', and space or comma seperate the character as two characters and connect then in the usual way.
Star Strider
Star Strider el 16 de Feb. de 2020
As always, my pleasure!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Workspace Variables and MAT-Files en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by