exa1_8.m

来自「有关matlab r2007的实用教程」· M 代码 · 共 13 行

M
13
字号
 u='If a woodchuck could chuck wood,';
disp(u)
i=find(u>='a' & u<= 'z');     %  find is a very powerful function!
u(i)=setstr(u(i)-('a'-'A'))

v=['Character strings having more than'
   'one row must have the same number '
   'of column just like matrices!     '];
disp(v)
i=find(v>='a' & v<='z');     %  here i is a single index vector into v,
v(i)=setstr(v(i)-('a'-'A'))     %  and matrix keeps the same orientation.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?