Having issues with parsing errors

조회 수: 1 (최근 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에서 String Parsing에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by