n=6; %which is variable, the number of vector's dimension.
i=1:(n-3);u=cos(i-3);u=u(:);jn=(2*cos(u(i)));
% I need to create below arrays with loop w.r.t. the "n" and "jn";
column_1=[0;0;0;jn(1);0;0]; %number of columns is equal (n-3)
column_2=[0;0;0;0;jn(2);0];column_3=[0;0;0;0;0;jn(3)];
Best Answer