| 查看: 1112 | 回复: 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);这句话中的标点也都是英文符号下的 实在不知道错误在哪 请各位高手帮帮忙~~ |
» 猜你喜欢
康复大学泰山学者周祺惠团队招收博士研究生
已经有6人回复
AI论文写作工具:是科研加速器还是学术作弊器?
已经有3人回复
孩子确诊有中度注意力缺陷
已经有6人回复
2026博士申请-功能高分子,水凝胶方向
已经有6人回复
论文投稿,期刊推荐
已经有4人回复
硕士和导师闹得不愉快
已经有13人回复
请问2026国家基金面上项目会启动申2停1吗
已经有5人回复
同一篇文章,用不同账号投稿对编辑决定是否送审有没有影响?
已经有3人回复
ACS Applied Polymer Materials投稿
已经有10人回复
RSC ADV状态问题
已经有4人回复
» 本主题相关价值贴推荐,对您同样有帮助:
求助啊......matlab
已经有10人回复
matlab调试问题
已经有3人回复
求教origin拟合简单的渗流方程(又称逾渗方程),做复合材料的应该会遇到吧
已经有20人回复
求助大侠帮忙,有关matlab模拟数据
已经有29人回复
while语句死循环了,求教
已经有6人回复
如何用matlab处理txt文件里的数据
已经有7人回复
请教一下虫友们sinulink的问题
已经有16人回复
【求助】MATLAB的plot怎么调整图标大小?
已经有7人回复
【求助】VS2005数值计算程序调试【急求!!!!加金币】
已经有9人回复
【求助】正态分布如何用MATLAB检验
已经有6人回复
【讨论】准备学MATLAB,请教哪些书比较经典
已经有33人回复


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

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

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













回复此楼