help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Want to know how to inluce octave fft lib in my Qt program


From: Prasanth N P
Subject: Re: Want to know how to inluce octave fft lib in my Qt program
Date: Thu, 24 Oct 2013 15:37:31 +0530




On Thu, Oct 24, 2013 at 3:04 PM, c. <address@hidden> wrote:

On 24 Oct 2013, at 11:05, Prasanth N P <address@hidden> wrote:
>
>   for (ucI=0; ucI< 1024; ucI++)
>     fscanf(fp, "%d\n", input_vector.fortran_vec () + ucI);
>

>   for (ucI=0; ucI< 1024; ucI++)
>       printf("%d\n",output_vector.fortran_vec () [ucI]);

This is not related to Octave API, you are reading and writing doubles formatting
them as integers with "%d":

http://www.cplusplus.com/reference/cstdio/printf/

BTW, why are you using C-style IO rather than C++?

http://www.cplusplus.com/reference/istream/istream/operator%3E%3E/
http://www.cplusplus.com/reference/ostream/ostream/operator%3C%3C/

That is a matter of taste, but I find that iostream is usually much more convenient ...

c.


Yes ofcourse I know that, but when I use iostream, it is found as some strange or unknown format of result set. I need the output as float or double. 


  for (ucI=0; ucI< 1024; ucI++)
     std::cout << ucI << "----" << output_vector.fortran_vec () [ucI] << "\n";


will produce result set as 

1.52985e-311
1.8092e-313
1.67617e-312
9.48677e-314
2.29452e-312
5.91922e-313
1.91471e-312
2.78877e-313
1.1621e-313
1.03975e-313
2.01928e-313
3.21101e-313
5.9721e-313
1.07526e-313
2.20929e-313
4.43025e-313
etc...


reply via email to

[Prev in Thread] Current Thread [Next in Thread]