Attachment 'write_complex_binary.m'

Download

   1 function v = write_complex_binary (filename, data)
   2 
   3 %% usage: write_complex_binary (filename, data)
   4 %%
   5 %%  open filename and write a list of complex numbers
   6 %%  as floats
   7   
   8   f = fopen (filename, 'wb');
   9   if (f < 0)
  10     v = 0;
  11   else
  12     for i=1:length(data)
  13         fwrite (f, real(data(i)), 'float');
  14         fwrite (f, imag(data(i)), 'float');
  15     end;
  16     fclose (f);
  17   end
  18 end

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view | diff] (2010-02-22 19:36:54, 1.3 KB) [[attachment:octave_read_complex_binary.m]]
  • [get | view | diff] (2010-02-22 19:36:54, 0.5 KB) [[attachment:read_complex_binary.m]]
  • [get | view | diff] (2010-02-22 19:36:55, 16.0 KB) [[attachment:toolkit.png]]
  • [get | view | diff] (2010-02-22 19:36:55, 0.4 KB) [[attachment:write_complex_binary.m]]
 All files | Selected Files: delete move to page
Normal Sort Sort + uniq Sort + uniq + count

You are not allowed to attach a file to this page.