Having issues with parsing errors
1 次查看(过去 30 天)
显示 更早的评论
I am attempting to write a script that will solve the Burgers equation utilizing both the McCormack and Roe methods. I know that the actual language of my script is correct after conferring with the professor. However, I receive a large series of parsing errors with regards to brackets:
Roe(j+2,n+2) = Roe(j+2,n+1)-dt/2/dx*((Froe_jph-Froe_jnh)-u_jph*(Roe(j+3,n+1)-Roe(j+2,n+1))+u_jnh*(Roe(j+2,n+1)-Roe(j+l,n+1))+r*(Roe(j+3,n+1)-2*Roe(j+2,n+1)+Roe(j+1,n+1)));
where every bolded bracket represents the same error message. If it is hard to see, it is basically the first bracket after "n+1", so "n+1)". I was told I might be missing an opening bracket, but I checked and did not notice anything missing. Any suggestions?
1 个评论
Dyuman Joshi
2023-11-29
The brackets seem to be correct.
Please copy and paste the whole error message i.e. all of the red text.
% 1 1 2 2 34 4 5 6 6
Roe(j+2,n+2) = Roe(j+2,n+1)-dt/2/dx*((Froe_jph-Froe_jnh)-u_jph*(Roe(j+3,n+1)...
%7 75 8 9 9 a a8 b c c
-Roe(j+2,n+1))+u_jnh*(Roe(j+2,n+1)-Roe(j+l,n+1))+r*(Roe(j+3,n+1) ...
% d d e eb3
-2*Roe(j+2,n+1)+Roe(j+1,n+1)));
回答(1 个)
Walter Roberson
2023-11-29
移动:Walter Roberson
2023-11-29
Roe(j+2,n+2) = Roe(j+2,n+1)-dt/2/dx*((Froe_jph-Froe_jnh)-u_jph*(Roe(j+3,n+1)-Roe(j+2,n+1))+u_jnh*(Roe(j+2,n+1)-Roe(j+l,n+1))+r*(Roe(j+3,n+1)-2*Roe(j+2,n+1)+Roe(j+1,n+1)));
^
The character I have marked copies into MATLAB as -- . I suspect it is an n-dash character.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 String Parsing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!