•
【例 2-1-1 】生成字符串实例。
•
>>str1=' Chongqing University',
•
str2=[ 'of',' ',' posts ',' ','and',' ','Telecommu','nication'] % 直接输入法
•
str1 =
•
Chongqing University
•
str2 =
•
of posts and Telecommunication
•
>> str=[str1,' ',str2] % 组合法
•
str =
•
Chongqing University of posts and Telecommunication
•
>>str3=' Don’t worry about his' % 字符串中有单引号 .
•
% 也可以 ' Don’’t worry about his'
•
str3 =
•
Don't worry about his
•
>>str4=['a':2:'n'] % 冒号表达式法
•
str4 =
•
acegikm
•
>>str5=char('MATLAB',' 及其工程应用 ') % 函数法
•
str5 =
•
MATLAB
•
及其工程应用
评论0
最新资源