Saturday, October 12, 2013

Creating CDF plot.

Generate a CDF plot

close all
y = randn(1,40000);
figure
hist(y,40)
title('Histogram')
% xlimit([-3,3])

  saveas(gcf, ['SAVE/',  'Histogram-Gaussian', num2str(mm)], 'png')

figure
cdfplot(y)
  saveas(gcf, ['SAVE/',  'CDF-Gaussian', num2str(mm)], 'png')
        

Monday, October 7, 2013

Load saved figure and save in fullscreen size

Code
% Load figure
filename =dir;
filename.name
for jj = 3:length(filename)
    this = filename(jj).name;
    hfig=  openfig(this,'reuse');
    set(hfig,'Units', 'Normalized', 'OuterPosition', [0 0 1 1]);
     set(hfig,'paperorientation','portrait');

 %     saveas(gcf,[this,'.png'])
% pause
 
end

Monday, June 17, 2013

Create SSH alias

Pretty easy!
In terminal do:
vi ~/.ssh/config #add the following lines Host myserver User username HostName host.server #then esc, :wq # Then ssh myserver should do the magic.
-->

Tuesday, May 28, 2013

copy the list of files to another folder

I had a list of file, to be copied to another folder location for compiling them together. This worked!
cat listFile.txt | while read line; do cp "$line" /Users/asdf/Documents/compile; done
-->

Sunday, February 10, 2013

Run matlab program from shell

This is nice!
#!/bin/bash filename=program.m; cat > $filename << EOF % It is matlab script disp('Hello World') A=zeros(3,3); if size(A)==3 disp('Hello again') end EOF chmod +x $filename matlab -nodesktop -nosplash -nodisplay -r "run ./$filename ; quit;"
-->

Tuesday, February 5, 2013

Recursive Action in Folders using matlab

I wanted to cleanup some of the old pdf files but not clean out the .doc/.tex in there. Also, .zip was of no use, so wanted to get rid of that too! This small matlab script did the job! jj=3 because . and .. are first two from the dir.
filename =dir; filename.name for jj = 3:length(filename) this = filename(jj).name; if isdir(this) this eval(['cd ' this]) !rm -r *.pdf !rm -r *.zip cd .. end end
-->