06.08.2013 Views

内容简介作者简介 - 科学与工程计算系

内容简介作者简介 - 科学与工程计算系

内容简介作者简介 - 科学与工程计算系

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

41379<br />

char(ASCII_A)<br />

ans =<br />

这是一个算例。<br />

(7)<br />

b='Example ''3.1.2-1'''<br />

b =<br />

Example '3.1.2-1'<br />

(8)<br />

ab=[a(1:7),' ',b,' .']<br />

ab =<br />

This is Example '3.1.2-1' .<br />

3.1.3 复杂串数组的创建<br />

3.1.3.1 多行串数组的直接创建<br />

【例 3.1.3.1-1】多行串数组的直接输入示例。<br />

clear<br />

S=['This string array '<br />

'has multiple rows.']<br />

S =<br />

This string array<br />

has multiple rows.<br />

size(S)<br />

ans =<br />

2 18<br />

3.1.3.2 利用串操作函数创建多行串数组<br />

【例 3.1.3.2-1】演示:用专门函数 char , str2mat , strvcat 创建多行串数组示例。<br />

S1=char('This string array','has two rows.')<br />

S1 =<br />

This string array<br />

has two rows.<br />

S2=str2mat('这','字符','串数组','','由 4 行组成')<br />

S2 =<br />

这<br />

字符<br />

串数组<br />

由 4 行组成<br />

S3=strvcat('这','字符','串数组','','由 4 行组成')<br />

S3 =<br />

这<br />

字符<br />

串数组<br />

由 4 行组成<br />

size(S3)<br />

ans =<br />

5 5<br />

3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!