Matlab实训字符串元胞和结构数组.ppt

  1. 1、本文档共35页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Matlab实训字符串元胞和结构数组.ppt

实训二 字符串数组、元胞数组和结构数组 2.1 字符串数组 2.2 元胞数组(单元数组) 2.3 结构数组(构架数组) 2.1 字符串数组 2.1.1 字符串构造 2.1.2 数字与字符串的相互转换 2.1.3 字符串函数 2.2 单元数组 2.2.1 单元数组的创建 2.2.2 单元数组处理 2.2.3 获得单元数组的内容 2.3 结构数组 2.3.1 创建结构数组 2.3.2 结构处理 2.3.3 获取结构内容 4.3.4 结构函数 要点 字符串数组的创建 字符串转换和操作函数 单元数组的创建和内容获取 结构数组的创建和内容获取 isfield(circle,color) ans = 1 isfield(circle,width) ans = 0 class(square) ans = struct isstruct(circle) ans = 1 d=pi; isstruct(d) ans = 0 fnames=fieldnames(circle) fnames = radius center linestyle color ‘filled circle2=rmfield(circle,fnames{5}) circle2 = 1x3 struct array with fields: radius center linestyle color circle3=rmfield(circle,radius) circle3 = 1x3 struct array with fields: center linestyle color filled * t=How about this character string? t = How about this character string? size(t) ans = 1 32 whos Name Size Bytes Class t 1x32 64 char array Grand total is 34 elements using 80 bytes u=abs(t) u = Columns 1 through 12 72 111 119 32 97 98 111 117 116 32 116 104 Columns 13 through 24 105 115 32 99 104 97 114 97 99 116 101 114 Columns 25 through 32 32 115 116 114 105 110 103 63 char(u) ans = How about this character string? u=t(16:24) u = character u=‘ Hello, ; v=‘ World! ; v=[ Character strings having more than one row must have the same number of column just like matrices! ] v = Character strings having more than one row must have the same number of column just like matrices! w=[u v] w = Hello,World! disp(w) Hello,World! lengends=char(‘Wilt’,‘Russel’,‘Kareem) lengends = Wilt Russel Kareem char(one,,tow,three) ans = one tow three strvcat(one,,two,three) ans = one two three 字符串转换成大写 upper 字符串转换成数字 str2num 字符串转换成一个文本矩阵 str2mat 用格式控制,字符串转换成数字 sscanf 用格式控制,数字转换成字符串 sprintf ASCII转换成字符串

文档评论(0)

rewfdgd + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档