cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Observer
Observer
166 Views
Registered: ‎01-01-2019

Complex numbers problem in SDK when using them in arrays

Jump to solution

Hi All,

 

I need to generate some complex coefficients in an array in Xilinx SDK.

What I am doing is using #include <complex.h> Written by Matthias Drochner.

It works well when I use it for a number not in array.

but I have a function like bellow:

void weight_generator(int N, float complex weights[100])
{
float complex cpmxpower;

for (int k =0;k<N/2;k++)
{
cpmxpower = 0 - 2 *I * M_PI * k / N;
weights[i] = cpmxpower ;

}
}

 

then it gives me error at "weights[i] = cpmxpower ;"

"

Multiple markers at this line
- 'i' undeclared (first use in this function)
- each undeclared identifier is reported only once for each function it
appears in

"

It doesnt understand "i" as imaginary part when I use it to give value to an element in an array.

Thanks for your help.

 

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
Highlighted
Observer
Observer
143 Views
Registered: ‎01-01-2019

Re: Complex numbers problem in SDK when using them in arrays

Jump to solution

Sorry, 

the problem is solved.

the "i" index was the problem.

 

View solution in original post

0 Kudos
1 Reply
Highlighted
Observer
Observer
144 Views
Registered: ‎01-01-2019

Re: Complex numbers problem in SDK when using them in arrays

Jump to solution

Sorry, 

the problem is solved.

the "i" index was the problem.

 

View solution in original post

0 Kudos