Having issues with parsing errors

3 次查看(过去 30 天)
Zachary
Zachary 2023-11-29
评论: Dyuman Joshi 2023-11-29
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
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
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.

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

标签

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by