Having issues with parsing errors
1 view (last 30 days)
Show older comments
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 Comment
Dyuman Joshi
on 29 Nov 2023
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)));
Answers (1)
Walter Roberson
on 29 Nov 2023
Moved: Walter Roberson
on 29 Nov 2023
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 Comments
See Also
Categories
Find more on String Parsing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!