function [Degauss_I] = Deguass_currents(f, num_points)
%Deguass_currents computes the currents for a bipolar degauss proceedure
%   Using the formula developed by Achim Weidemann 
%I =  (-(-1).^n).*-f.^n*Imax  where n = 0:num_points

% Setup Parameters

n = [0:num_points];
Imax = 9.0;


Degauss_I = ((-1).^n).*f.^n*Imax;

data_file = ['Degauss Currents f = ' num2str(f) '.txt']   
    title = ['Degauss currents for various f = ' num2str(f) ' using I =  (-(-1).^n).*-f.^n*Imax  where n = 0:' num2str(num_points),', totals point = ',num2str(num_points+ 2) , '\n' ];
  
    
fidC = fopen(data_file,'w');

fprintf(fidC,title);
fprintf(fidC,'Degauss I = {0.0, ');
for i = 1:n(end)+1
fprintf(fidC,'%7.4f, ',  Degauss_I(i));
end
fprintf(fidC,'0.0};');
fclose(fidC);

end

