| 查看: 1153 | 回复: 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);这句话中的标点也都是英文符号下的 实在不知道错误在哪 请各位高手帮帮忙~~ |
» 猜你喜欢
请教限项目规定
已经有5人回复
拟解决的关键科学问题还要不要写
已经有8人回复
最失望的一年
已经有16人回复
存款400万可以在学校里躺平吗
已经有33人回复
求助一下有机合成大神
已经有3人回复
求推荐英文EI期刊
已经有5人回复
26申博
已经有3人回复
基金委咋了?2026年的指南还没有出来?
已经有10人回复
基金申报
已经有6人回复
疑惑?
已经有5人回复
» 本主题相关价值贴推荐,对您同样有帮助:
求助啊......matlab
已经有10人回复
matlab调试问题
已经有3人回复
求教origin拟合简单的渗流方程(又称逾渗方程),做复合材料的应该会遇到吧
已经有20人回复
求助大侠帮忙,有关matlab模拟数据
已经有29人回复
while语句死循环了,求教
已经有6人回复
如何用matlab处理txt文件里的数据
已经有7人回复
请教一下虫友们sinulink的问题
已经有16人回复
【求助】MATLAB的plot怎么调整图标大小?
已经有7人回复
【求助】VS2005数值计算程序调试【急求!!!!加金币】
已经有9人回复
【求助】正态分布如何用MATLAB检验
已经有6人回复
【讨论】准备学MATLAB,请教哪些书比较经典
已经有33人回复


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

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

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













回复此楼