This is valid MATLAB code.
As long as i has been defined as an array containing only positive integer values or a logical array before this line, this too is valid MATLAB code. If it hasn't been defined as an array this attempts to assign to the sqrt(-1) element of NN and that is not a valid operation in MATLAB.
Valid MATLAB code.
Not valid MATLAB code. This looks like something close to a C or C++ for loop.
And there is no ++ operator in MATLAB. Two plus signs next to one another can be valid (++1 is just 1 due to two calls to uplus, 2++3 is 5 because it's a call to uplus for +3 then a call to plus to add together 2 and 3) but it's not usually needed.
Again, this is closer to C than MATLAB. For loops in MATLAB do not have their body delimited by curly braces, they end with an end matching the for.
The command to open a figure window in MATLAB is figure. The case matters.
Similarly the function usually used to create a line plot is plot not Plot.
Since I'm guessing you're new to MATLAB, I suggest you start with the free MATLAB Onramp tutorial (https://www.mathworks.com/support/learn-with-matlab-tutorials.html) to quickly learn the essentials of MATLAB.