You value of k is [0,1,1,….]. While running the loop, it will throw this error,
Subscript indices must either bereal positive integers or logicals.
,for sure because you are using M3(k,1) later in the program, which never be possible in case of k=0;
Best Answer