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

errorparseparse and unbalanced or unexpected parenthesis or bracket error.

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.

Best Answer

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.