for ii=1:24

stochastic(paramfile, jobfile, ii);

end

In at least one case, the solution to this cryptic error message:

Segmentation violation occurred within signal handler.was to simply run matlab with the display option on.

[~, ind] = sort(X)

dbstop postprocess postprocess dbstep 98The dbstep command here executes the first 98 commands, then stops.

Now you can see the values of variables from the matlab command line.

The singleCompThread option can reduce matlab's tendency to request enormous chunks of memory that it doesn't end up using.

function stochastic(paramsFile, jobsFile, jobNumber)

params.jobNumber = strassign(jobNumber);

if params.jobNumber==0

return;

end

...

return

Don't forget to do str2num(variable) if it is a number!

There is another handy function called num2str.

[status, host] = system('hostname');

pid = feature('getpid')

This is an undocumented matlab feature.

ra=radec(:,1); %first column

dec=radec(:,2); %second column

etparams.parameters(2)={'0.1'};

[temp setnum]=regexp(matfilename,'SpHSet(.*)\.job.*','match','tokens');

setnum=str2num(char(setnum{1}));

% s is 8000 x 1 and you want to make it 8000 x 100

T = 100;

q = repmat(s, 1, T);

% s is 1 x 8000 and you want to make it 100 x 8000

q = repmat(s, T, 1);

phase_n = kron(ones(length(xpos),1),exp(-2*pi*i*freqs(cut2)*lag));

delay = tf(num,den);

bode(delay,{10^3,10^5});

(The "c" is for color.)

plot(data(:,3),data(:,4),'r',data(:,3),data(:,5),'b');

legend('real','imaginary');

f=load('jobs1-5.diff');

hist(f)

subplot(2,1,1); plot(x1,y1)

subplot(2,1,2); plot(x2,y2)

h_xlabel = get(gca,'XLabel');

set(h_xlabel,'FontSize',20);

qq1=scatter(...

qq1Child=get(qq1,'Children');

set(qq1Child,'MarkerSize',8);

qq2=errorbar(...

set(qq2,'MarkerSize',13);

set(qq3,'MarkerSize',13);

[C, h] = contour(A_ii, alpha_jj, z, zcontours);

x1 = C(1, 2:end);

y1 = C(2, 2:end);

semilogx(x1, y1, 'b', 'linewidth', 2);

h1 = plot(x1, y1)

...

legend([h1 h2 h3], 'stoch', 'CBC', 'combined', 'true');

% pink R2=loglog(sn.freqs, sn.ul0); set(R2,'Color',[1,0.4,0.6]); % purple Q2=loglog(sn.freqs, sn.h_sig); set(Q2,'Color',[0.5,0,0.5]);

% use matlab 2014

[ax, h] = plot2axes(@loglog, f, r, 'yscale', (4000/1e-12));

fs = 16;

ylabel(ax(1), 'strain/pT', 'FontSize', fs);

ylabel(ax(2), 'm/T', 'FontSize', fs);

xlabel('f (Hz)', 'FontSize', fs);

set(gca, 'FontSize', fs);

grid on;

print('-dpng', 'coupling');

out = [t hp hx];

save('wave_inj.dat', 'out', '-ASCII');

fid=fopen('.inj/inj_params.txt','w+');

fprintf(fid, '%c', out);

fclose(fid);

1 is for std:out, 2 is for std:err, or to...

fid=fopen('file.out','w+');

fprintf(fid,'%f \n',jobNumber);

fclose(fid)

This will return an array tmp with N entires, one for each .mat file matching the regular expression. The name of the 13th file in this array is: tmp(13).name

filename = '/data/node3/ethrane/file.mat'; [temp2 node] = regexp(filename,'/data/node(.).*','match','tokens');

fft_eht.m: a function to keep track of frequency bins when Fourier transforming time-series data.

ifft_eht.m: a function to keep track of frequency bins when inverse Fourier transforming

noise_gen.m: a function to generate colored noise

cal_fluence.m: a function go calculate GW fluence from a time series; also demonstrates Parseval's theorem (if you comment out a few lines of code).

These commands will create a directory called profile_results/ filled with html files of the form file#.html. Begin by opening file0.html. In our example, this will correspond to the main function, run_stochmap.m. Now you can step through each subroutine by following the hyperlinks from file0.html.