From: moonman on
clc
CCI=[];
for n=2:5
for N=1:30
CCI=power((sqrt(3*N)),n)/6;
CCI=10*log10(CCI)
end
end

I have written a simple code but i am unable to save the answer in an array. Secondly i want that when value of n=2; the thirty values of CCI be saved in a vector, then for =3 and so on
I mean i should be having four vectors of CCI and each vector having 30 values. Actually i will later ues these vectors individually for plotting. Thnaks
From: Jan Simon on
Dear Moonman!

> clc
> CCI=[];
> for n=2:5
> for N=1:30
> CCI=power((sqrt(3*N)),n)/6;
> CCI=10*log10(CCI)
> end
> end
>
> I have written a simple code but i am unable to save the answer in an array. Secondly i want that when value of n=2; the thirty values of CCI be saved in a vector, then for =3 and so on
> I mean i should be having four vectors of CCI and each vector having 30 values. Actually i will later ues these vectors individually for plotting. Thnaks

At first I'd omit CLC, because it is useless.

Do you something like this:
CCI = zeros(1, 30);
for n = 2:5
for N = 1:30
tmp = power((sqrt(3 * N)), n) / 6;
CCI(N) = 10 * log10(tmp);
end
end

I'd suggest to read the "Getting started" section of Matlab's documentation.

Kind regards, Jan