当前位置: 首页 > news >正文

网站建设论文百度云盘广告推广网站怎么做

网站建设论文百度云盘,广告推广网站怎么做,郑州网球公开赛,长丰县住房和建设局网站文章目录Part.I 元胞相关Chap.I 创建空 char 型元胞Part.II 矩阵相关Chap.I 矩阵插入元素Part.III 字符串相关Chap.I 获取一个文件夹下所有文件的文件名的部分内容Part.IV 结构体相关Chap.I 读取结构体Chap.II 取结构体中某一字段的所有值本篇博文记录一些笔者使用 Matlab 时根据自己的需求编写的一些小函数。 Part.I 元胞相关 Chap.I 创建空 char 型元胞 matlab可以创建空元胞矩阵cell(a,b);只不过创建好之后里面存储的类型是空double笔者想要创建一个空元胞矩阵且里面存放的数据类型是char所以笔者编写了这样一个函数 % get a null cell which is a*b dims function datakcell(a,b) datacell(a,b); for i1:afor j1:bdata(i,j)cellstr(num2str(data{i,j}));end end endPart.II 矩阵相关 Chap.I 矩阵插入元素 Matlab 在一个行向量/列向量某个位置处插入一个值 % insert num at ind in mat function datainsert(mat,ind,num) nlength(mat); data(ind)num; data(1:ind-1)mat(1:ind-1); data(ind1:n1)mat(ind:n); endPart.III 字符串相关 Chap.I 获取一个文件夹下所有文件的文件名的部分内容 最近搞事情想从一个目录中提取所有文件的文件名中前几个字符并转换为char。原来发现我一直存在一个误区“ 和引起来的东西是相同的”。今天才发现是不同的然后又学到了一写新的东西比如元素取唯一获取目录中所有文件的名字…… % get sitename from a dir function sitegetSite_dir(enudir) dirOutput dir(fullfile(enudir));% 此行下面一行获取目录所有文件名 plyName {dirOutput.name}; % get a cell mat plyName plyName(3:end); % rm . and .. nlength(plyName); sitelist; for i1:nfnameplyName{i};siteliststrcat(sitelist, ,fname(1:4)); end sitelistunique(regexp(strtrim(sitelist), \s, split)); %string2char nsitelength(sitelist); site[]; for i1:nsitetmpchar(sitelist(i));tmplower(tmp);site[site;tmp]; end end注regexp是以空格为分隔符将str变为str array。char是用单引号引起来的字符串string是用双引号引起来的字符串两者之间的转化用它们的名字即可char合并用[]string合并用strcmp。 Part.IV 结构体相关 Chap.I 读取结构体 比如我现在想读取这样一个文件到结构体中。文件内容如下 name sex age hobby aa man 4 8 ab wom 5 9 bb wom 6 10 cc man 7 11实现函数如下 % get struct from clkdif file function sturead_dif(file) fidfopen(file,r); str fgetl(fid); S regexp(str, \s, split); %field nlength(S); j1; while ~feof(fid)str fgetl(fid);strstrtrim(str); %rm the blankSpace on the beg and endif str(1)-continue;endif str(1:3)EOFbreak;endtmp regexp(str, \s, split);for i1:neval([stu(j).,S{i},tmp{i};]);endjj1; end fclose(fid); end调用示例 clc;clear; fileC:\Users\OHanlon\Desktop\a.txt; tic; sturead_dif(file); toc;Chap.II 取结构体中某一字段的所有值 可以和上面的函数配合使用 % get the field value from sta function dataget_fdata(sta,field) data[]; affieldnames(sta); nlength(af); for i1:nif mstrcmp(af{i},field)0break;end end if (mstrcmp(af{i},field)~0)disp(----error----);disp([The filed ,field, is not in sta!]);disp(------end----);return; end mlength(sta); for i1:mdataeval([[data;sta(i).,field,];]); end end
http://www.hkea.cn/news/14327502/

相关文章:

  • 下载中心官方网站建设银行河间市网站建设价格
  • 山西省城乡建设厅网站wordpress编辑器推荐
  • 做网站公司商丘代运营套餐价格表
  • 太原网站建设推广公司推荐黄冈智能网站建设平台
  • 合肥的网站建设公司哪家好沈阳网站制作 房小二网
  • 做flash网站框架引擎公司网站开发比选
  • 广州外贸建站手机网站 兼容
  • 一级a做爰片软件网站沈阳好的男科医院是哪一家
  • 温州建设诚信网站制作好的网页
  • 遵义网站制作和推广外贸产品销量排名
  • 家具网站asp小门户网站模版
  • 手机免费网站制作 seo won
  • 做网站的抬头标语怎么沈阳网站制作方法
  • 南宁网站开发软件怎么把网站放到空间
  • 网站设计工资怎么样公司网站兰州建设需要多少钱
  • 微信做模板下载网站买服饰网站建设
  • 门头沟富阳网站建设遵义网站开发公司
  • 网站怎么做免费seo搜索ios中国地图行政区划图sdk
  • 西安必途网站建设培训中心电子网站建设前台设计
  • 织梦网站主页hdmi高清wifi无线传输器
  • 京东网站推广方式wordpress调用错误模板的原因
  • 恩施哪里有做网站的网络推广优化能有排名吗
  • 黄岛网站建设价格有哪些游戏可以做网站
  • 如何维护建设网站做网站自己能做百度推广吗
  • dnf游戏币交易网站建设苏州做网站知识的分享
  • 网站建设与维护中wordpress禁止抓取分页
  • 网站建设网站开发dedecms 网站安装
  • 如何建一个免费网站用一个口罩做一把枪
  • 成都网站优化中原区网站建设
  • 网站建设公司工资设置wordpress健康主题