| 查看: 1141 | 回复: 3 | ||
| 当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖 | ||
[求助]
matlab调试问题
|
||
|
用matlab将.car文件转换为lammps的data文件时总是报错 运行到:[~,x,y,z,~,element1,perx,pery,perz,charge] = read_msi_file(filename); 报错:??? [~,x,y,z,~,element1,perx,pery,perz,charge] = read_msi_file(filename); | Error: Expression or statement is incorrect--possibly unbalanced (, {, or [. read_msi_file源文件如下:function [ID,x,y,z,monomer,element,perx,pery,perz,charge] = read_msi_file(filename) %filename = 'poly.car'; fid = fopen(filename); % read the file header header.line1 = fgetl(fid); header.line2 = fgetl(fid); header.line3 = fgetl(fid); header.line4 = fgetl(fid); % Get the periodic boundary lengths tline = fgetl(fid); text_format='%*s %f %f %f %*f %*f %*f %*s'; clear C C = textscan(tline, text_format, 1);%第5行 C[1]~C[3] perx = C{1}; pery = C{2}; perz = C{3}; % Output parameters into element for element 'ename' tline = fgetl(fid);%第六行 continue_loop = 1; count = 0; while continue_loop text_format='%s %f %f %f %s %u %s %s %f'; clear C C = textscan(tline, text_format, 1);%C[1]~C[9] count = count + 1; ID{count} = C{1}; x(count) = C{2};%double y(count) = C{3}; z(count) = C{4}; monomer(count) = C{6};%单元结构unit32 element{count} = C{8}; charge(count) = C{9}; tline = fgetl(fid); matches = strfind(tline, 'end'); num = length(matches); if num > 0 && matches == 1 tline = fgetl(fid); matches = strfind(tline, 'end'); num = length(matches); if num > 0 && matches == 1 continue_loop = 0; end end end fclose(fid); end read_msi_file源文件运行时没有问题,[~,x,y,z,~,element1,perx,pery,perz,charge] = read_msi_file(filename);这句话中的标点也都是英文符号下的 实在不知道错误在哪 请各位高手帮帮忙~~ |
» 猜你喜欢
求个博导看看
已经有12人回复
上海工程技术大学张培磊教授团队招收博士生
已经有3人回复
上海工程技术大学【激光智能制造】课题组招收硕士
已经有5人回复
求助院士们,这个如何合成呀
已经有4人回复
临港实验室与上科大联培博士招生1名
已经有9人回复
想换工作。大多数高校都是 评职称时 认可5年内在原单位取得的成果吗?
已经有7人回复
需要合成515-64-0,50g,能接单的留言
已经有4人回复
自荐读博
已经有4人回复
写了一篇“相变储能技术在冷库中应用”的论文,论文内容以实验为主,投什么期刊合适?
已经有6人回复
带资进组求博导收留
已经有10人回复
» 本主题相关价值贴推荐,对您同样有帮助:
求助啊......matlab
已经有10人回复
matlab调试问题
已经有3人回复
求教origin拟合简单的渗流方程(又称逾渗方程),做复合材料的应该会遇到吧
已经有20人回复
求助大侠帮忙,有关matlab模拟数据
已经有29人回复
while语句死循环了,求教
已经有6人回复
如何用matlab处理txt文件里的数据
已经有7人回复
请教一下虫友们sinulink的问题
已经有16人回复
【求助】MATLAB的plot怎么调整图标大小?
已经有7人回复
【求助】VS2005数值计算程序调试【急求!!!!加金币】
已经有9人回复
【求助】正态分布如何用MATLAB检验
已经有6人回复
【讨论】准备学MATLAB,请教哪些书比较经典
已经有33人回复


3楼2012-06-28 10:23:49

2楼2012-06-26 18:03:21

4楼2012-06-28 11:18:46







回复此楼
