I want to create a 1*n vector A, where each successive element is square of previous. Now if i write A(n)=(A(n-1))^2 Matlab takes n as the last element. Is there a way to generalize n? Or any other way to get such a vector? Thanks.
MATLAB: Generalization of nth index
indexing
Best Answer