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!