初学matlab 小问题自己看matlab,看到这一段有一句不太明白.>> x='MATLAB is a good software'x =MATLAB is a good software>> ascii_x=double(x)ascii_x = Columns 1 through 17 77 65 84 76 65 66 32 105 115 32

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/10 23:54:57
初学matlab 小问题自己看matlab,看到这一段有一句不太明白.>> x='MATLAB is a good software'x =MATLAB is a good software>> ascii_x=double(x)ascii_x =  Columns 1 through 17    77    65    84    76    65    66    32   105   115    32

初学matlab 小问题自己看matlab,看到这一段有一句不太明白.>> x='MATLAB is a good software'x =MATLAB is a good software>> ascii_x=double(x)ascii_x = Columns 1 through 17 77 65 84 76 65 66 32 105 115 32
初学matlab 小问题
自己看matlab,看到这一段有一句不太明白.
>> x='MATLAB is a good software'
x =
MATLAB is a good software
>> ascii_x=double(x)
ascii_x =
Columns 1 through 17
77 65 84 76 65 66 32 105 115 32 97 32 103 111 111 100 32
Columns 18 through 25
115 111 102 116 119 97 114 101
>> xxx=find(x>='a'&x> ascii_x(xxx)=ascii_x(xxx)-32; %就这一句不明白啊
>> char(ascii_x)
ans =
MATLAB IS A GOOD SOFTWARE
功能就是把字符串中小写字母改变为大写字母.
问题是:
ascii_x(xxx)=ascii_x(xxx)-32; 这一句
我知道这句要实现的功能,
这一句似乎是把 ascii_x 当函数来用了,是不是?要不然后面怎么带括号啊?
但在这之前,ascii_x 明明是变量啊!
如果是函数,为什么,是定义的新函数?
细一想,double(x) 这种习惯似乎和C不一样,求大神也解释一下.

初学matlab 小问题自己看matlab,看到这一段有一句不太明白.>> x='MATLAB is a good software'x =MATLAB is a good software>> ascii_x=double(x)ascii_x = Columns 1 through 17 77 65 84 76 65 66 32 105 115 32
ascii_x=double(x)
这里ascii_x是一个数值型向量
xxx=find(x>='a'&x