Ghostscript error -1, status -100 in saveas

2 views (last 30 days)
Steven
Steven on 6 May 2011
I have obtained a bizarre error when trying to write an image file. Output of ver is
-------------------------------------------------------------------------------------
MATLAB Version 7.10.0.499 (R2010a)
MATLAB License Number: XXXXXX
Operating System: Linux 2.6.18-194.32.1.el5 #1 SMP Wed Jan 5 17:52:25 EST 2011 x86_64
Java VM Version: Java 1.6.0_12-b04 with Sun Microsystems Inc. Java HotSpot(TM) 64-Bit Server VM mixed mode
-------------------------------------------------------------------------------------
The error:
??? Error using ==> print at 339
Problem converting PostScript. System returned error: -1.Failed to convert to output format; Ghostscript status: -100.Error: /rangecheck in --string--heck
Operand stack:
picstr 132300
Execution stack:
Error in ==> saveas at 155
print( h, name, ['-d' dev{i}] )
Error in ==> STFT_test at 63
saveas(fig_hndl, 'sig_1_STFT.jpg')
The code that produced it is below:
Signal 1: Quadratic chirp %%%
a = 100;
time_length = 10;
t_v = 2; %vertex position in time (signal 1)
f_v = 30; %vertex position in frequency (signal 1)
f_2 =440; %frequency of signal 2
f_s = 44100;
n = [0:time_length*f_s-1];
t = n./f_s;
sig_1 = cos(2*pi*(a*(t-t_v).^2 + f_v*t))';
wavwrite(sig_1, 44100, 16, 'signal_1.wav')
sig_2 = cos(2*pi*(f_2*t))';
wavwrite(sig_2, 44100, 16, 'signal_2.wav')
Plot Signals %%%
signals_display = figure
t_a = 2.5
t_b = 3.5
subplot(2, 1, 1)
plot(t(f_s*t_a:f_s*t_b), sig_1(f_s*t_a:f_s*t_b))
axis([t_a, t_b, -max(abs(sig_1(f_s*t_a:f_s*t_b))), max(abs(sig_1(f_s*t_a:f_s*t_b)))])
title('Quadratic chirp')
subplot(2, 1, 2)
plot(t, sig_2)
axis([0, 10, -max(abs(sig_2)), max(abs(sig_2))])
title('Simple cosine')
saveas(signals_display, 'signals.jpg')
STFT of each signal %%%
numOctaves = 10;
G_f=32
G_n=50
f = 2.^[3:1/G_f:3+numOctaves]; %Set-up for logarithmic frequency
zone = [1 1 f_s*time_length; 0 16 2048]
size_half_win = f_s*.02
% Signal 1 %
win = .54 - .46*cos(pi*[0:size_half_win*2]'/size_half_win); %Hamming window
sig_1_STFT = TFD('STFT', sig_1, zone, f_s, win);
% Signal 2 %
win = .54 - .46*cos(pi*[0:size_half_win*2]'/size_half_win); %Hamming window
sig_2_STFT = TFD('STFT', sig_2, zone, f_s, win);
% Assemble picture file %
fig_hndl=figure
subplot(2,1,1)
image([0 time_length], [zone(2,1) zone(2,3)], sig_1_STFT); set(gca, 'YDir', 'normal');
title('STFT of QChirp, Hamming 20 ms'); xlabel('Time (s)'); ylabel('Frequency (Hz)');
subplot(2,1,2)
image([0 time_length], [zone(2,1) zone(2,3)], sig_2_STFT); set(gca, 'YDir', 'normal');
title('STFT of Simple Cosine, Hamming 20 ms'); xlabel('Time (s)'); ylabel('Frequency (Hz)');
saveas(fig_hndl, 'sig_1_STFT.jpg')
I have tried making the data to be written quite a bit smaller by decreasing the number of data points used to make the pictures, and I tried not writing the other picture (which comes out fine). I tried writing to a few different formats. No matter what I do, I get the exact same error, except the extension changes. What is happening?

Answers (1)

Kaustubha Govind
Kaustubha Govind on 6 May 2011
This seems related to Bug#454985.

Categories

Find more on MATLAB in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!