how characters connected in quotes

1 次查看(过去 30 天)
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!

采纳的回答

Star Strider
Star Strider 2020-2-15
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 个评论
Qian Li
Qian Li 2020-2-16
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.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Workspace Variables and MAT-Files 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by