matlab2014a中help与参考页翻译 Character Strings
来源:互联网 发布:winpe启动盘制作软件 编辑:程序博客网 时间:2024/05/18 12:31
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Character Strings 字符串
A character string is a sequence of any number of characters enclosed in single quotes. You can assign a string to a variable.
一个字符串就是用两个单引号围起来的,许多个字符。
myText = 'Hello, world';
If the text includes a single quote, use two single quotes within the definition.
如果你文本中包含了单引号,那么按照规定,你需要两个单引号联合表示。
otherText = 'You''re right'
otherText =
You're right
myText and otherText are arrays, like all MATLAB® variables. Their class or data type is char, which is short for character.
myText 和 otherText都是数组,就像所有MATLAB的变量一样。他们类或者说数据类型是char,短字符.~~~~(>_<)~~~~
whos myText
Name Size Bytes Class Attributes
myText 1x12 24 char
You can concatenate strings with square brackets, just as you concatenate numeric arrays.
你可以用方括号来连接字符串,就想你连接数字类型得到数组一样。
longText = [myText,' - ',otherText]
longText =
Hello, world - You're right
To convert numeric values to strings, use functions, such as num2str or int2str.
为了转换数值型变量到字符串型的,我们可以用函数,例如num2str 或者int2str.
f = 71;
c = (f-32)/1.8;
tempText = ['Temperature is ',num2str(c),'C']
tempText =
Temperature is 21.6667C
好强呀。。。;-)
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
我是一个新手,翻译还有许多不完善的地方,请您看翻译的时候多多思考。
MATLAB是一个优秀的软件,值得学习。如果您有一些不会的知识,咱们可以相互讨论。
如果您认为翻译可以有改进的地方,有错误的地方,请留下评论,我会处理的。
注:如果我的博文无意中侵犯了您的权益,请告知。看到您的告知后,我将及时作出处理。
- matlab2014a中help与参考页翻译 Character Strings
- matlab2014a中help与参考页翻译 limit
- matlab2014a中help与参考页翻译 find
- matlab2014a中help与参考页翻译 roots
- matlab2014a中help与参考页翻译 all
- matlab2014a中help与参考页翻译 not
- matlab2014a中help与参考页翻译 and
- matlab2014a中help与参考页翻译 or, |
- matlab2014a中help与参考页翻译 xor
- matlab2014a中help与参考页翻译 MATLAB Product Description
- matlab2014a中help与参考页翻译 cat
- matlab2014a中help与参考页翻译 tutorials-desktop basics
- matlab2014a中help与参考页翻译 Tutorials- array indexing
- matlab2014a中help与参考页翻译 Calling Functions
- matlab2014a中help与参考页翻译 ans
- matlab2014a中help与参考页翻译 clc
- matlab2014a中help与参考页翻译 Logical Operators: Short-Circuit && ||
- matlab2014a中help与参考页翻译 Tutorials-matrices and arrays- Array Creation
- java集合15--set架构
- 语法篇7之clr属性
- C++第五次实验-------多继承
- 语法篇8之特性
- Cent OS JDK8安装
- matlab2014a中help与参考页翻译 Character Strings
- Android Button
- JDBC查询数据库中的数据
- 进程与线程之间的区别及联系
- 手机移动端WEB资源整合
- Android Handler Message 在使用多个Handler时,接收不到消息的处理办法
- c++第5次实验
- N个字符串全排列
- 提高篇项目2——求解分段函数的值