Function that calls plot

Andnan <[email protected]> Sun, 2 Jul 2006 11:47:15 -0700 (PDT)
Newsgroups gmane.comp.gnu.octave.graphics
Message-ID <[email protected]>
I'm trying to make a FFT plotting function that's a little better then
gplot(abs(fft));

I want the frequency axis centered at 0 and I want the frequency axis
normalized.

My probelm is that I want to pass the name of the file to save to plot to as
a parameter and I can't get it working.  Here's my code.

function OctaveFFTPlot(x,file_name)
	clf;
	grid on;		#turn on the grid
	
	# Amplitude plot
	yLabel('Amplitude');		#Set the y axis	
	
	fft_data = fft(x);			#do an FFT on the sample data
	
	fftshift(fft_data);
	
	# create a normaized frequency axis for the plot
	normal_f=(1:length(fft_data))./ length(fft_data);
	normal_f = normal_f.-0.5;
	
	plot(normal_f,abs(fft_data));
	gset out file_name;
	gset terminal gif;
	replot;	
	closeplot;
end;

It is not saving the file to the file_name.

any Ideas?
-- 
View this message in context: http://www.nabble.com/Function-that-calls-plot-tf1881157.html#a5142447
Sent from the Octave - Graphics forum at Nabble.com.