keremcant
Member level 5
I am trying to create an array inside a for loop and then I will plot it in MATLAB. bu I am tring to do it by incrementing the variable by 0.01 at one time. like this:
it gives me the error : Attempted to access F2(6); index must be a positive integer or logical.
this seems silly because 6 is a positive integer index and also it can make the code work until 6 but at 6 it gives an error
what am I doing wrong??
thanks in advance
Code:
for w = 0.01:0.01:20
F2(100*w) = G/abs(w^4 - C*G*w^2 + G);
end
it gives me the error : Attempted to access F2(6); index must be a positive integer or logical.
this seems silly because 6 is a positive integer index and also it can make the code work until 6 but at 6 it gives an error
what am I doing wrong??
thanks in advance