Home > Back-end >  Which can help me to change, how to output the window function value, thank you!
Which can help me to change, how to output the window function value, thank you!

Time:09-26

Which can help me to change, how to output the window function value, thank you!

# include "math. H"
# include & lt; Stdlib. H>
# include & lt; Stdio. H>
# include & lt; String. H>
# define PI 3.1415926
Void hammingWin (int N, double * * w);
Void hammingWin (int N, double * * w)
{
int n;
Double * ret;

Ret=(double *) malloc sizeof (N * (double));
If (ret=! NULL)


For (n=0; N & lt; N; N++)
{
+ n * (ret)=0.54-0.46 * cos (2 * PI * (double) n/(n - 1));
}

* w=ret;


Free (ret);
return ;
}

Void main ()
{
int n;
Double * ret;

* ret=hammingWin (9, & amp; W);

Printf (" % f ", * ret);

}

CodePudding user response:

If (ret=! NULL) is the if (ret!=NULL)

CodePudding user response:

Double hammingWin (int N)
{
Double ret.
,,,
Ret=you dongdong

Return (ret);

}


Double xx;
Xx=hammingWin (8);
Printf (" % f ", xx);

CodePudding user response:

This pointer,,, good chaos

CodePudding user response:

Calls the method is wrong, it should be:
Double * ret;
HammingWin (9, & amp; Ret);
Printf (" % f ", * ret);

CodePudding user response:

In addition, free (ret); Do not put in hammingWin inside, this line of take out, should be;
Double * ret;
HammingWin (9, & amp; Ret);
Printf (" % f ", * ret);
Free (ret);
  • Related