Just copy code from one file to other and got (Parse and Unbalanced or unexpected parenthesis or bracket error.)

11 views (last 30 days)
I am working on Matlab. I was creating synthetic data in 4D Matrix. It was running just fine and was creating synthetic data. I just copied the code to my other file to add some changes into it. but before i modify i got the (Parse and Unbalanced or unexpected parenthesis or bracket error) without having a single change in the code. Now my old file that was working fine is also giving the same error. every thing is balance and was working fine i just copied it to other file. please help me to fix this error. Attaching a screenshot of my code and error.

Accepted Answer

Steven Lord
Steven Lord on 11 Jan 2016
You pasted your DataSet1 command into the wrong place. Cut it from its current location on line 9 and paste it into the inner loop, then (if necessary) make it so the "t = ..." line follows the for keyword on line 9. They should be on the same line.
Or eliminate the FOR loops entirely.
DataSet1 = randn(M, N, T, V);
This way you don't need to preallocate them to be ZEROS arrays first, either.

More Answers (0)

Community Treasure Hunt

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

Start Hunting!