Simple question of matlab

Status
Not open for further replies.

moonnightingale

Full Member level 6
Joined
Sep 17, 2009
Messages
362
Helped
5
Reputation
10
Reaction score
5
Trophy points
1,298
Activity points
3,832
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
 

Hi

You are not saving the data in an array.

Try this..

Code:
clc
CCI=zeros(4,30);
N=1:30;
for n=2:5
    CCI(n-1,:)=power((sqrt(3*N)),n)/6;
end

By the way is this some homework?
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…