0% found this document useful (0 votes)
28 views1 page

Function C

This function takes in parameters n, alpha0, alpha, beta, gamma and generates a vector c of length 2n. It initializes omega values from 0 to pi in increments of pi/n. It then assigns values to c based on the omega values - U0 until alpha0, U1 until alpha, U2 until beta, U3 until gamma, and U4 from gamma to pi. All other values in c are set to 0.

Uploaded by

hikol
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
28 views1 page

Function C

This function takes in parameters n, alpha0, alpha, beta, gamma and generates a vector c of length 2n. It initializes omega values from 0 to pi in increments of pi/n. It then assigns values to c based on the omega values - U0 until alpha0, U1 until alpha, U2 until beta, U3 until gamma, and U4 from gamma to pi. All other values in c are set to 0.

Uploaded by

hikol
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

%%%%%%%%%%%%%%%%%%%%%%%%%%%%% FUNCTION C %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function c=c(n,alpha0,alpha,beta,gamma)
c=zeros(2*n,1) ;
for i=1:n+1
omega(i)=(i-1)*pi/n;
end
U0=1;
U1=10^(-3.4);
U2=10^(-1)
U3=1;
U4=0.1;
i=1;
while omega(i)<alpha0
c(i)=U0;
i=i+1;
end
while omega(i)<alpha
c(i)=U1;
i=i+1;
end
while omega(i)<beta
c(i)=U2;
i=i+1;
end
while omega (i)<gamma
c(i)=U3;
i=i+1;
end
while omega(i)<pi
c(i)=U2;
i=i+1;
end
for i=n+1:2*n
c(i)=0;
end

You might also like