Skip to content

Instantly share code, notes, and snippets.

View mdaddysman's full-sized avatar

Matthew mdaddysman

View GitHub Profile
tic
filename = 'Simulated1';
ntraj = 1000;
maxlength = 3000;
H = round( random('unif',0.1,0.9,[ntraj,1]) .* 1000 ) ./ 1000; %longer decimals appear to give problems
lengths = random('unid',maxlength-1,[ntraj,1]) + 1;
logD = random('norm',0,0.5,[ntraj,1]);
D = 2.^logD;
@mdaddysman
mdaddysman / PlotColor.m
Created September 27, 2017 14:38
Simple code for adding continuous color scale to a line plot in Matlab
%generate a set of offset lines
nlines = 10;
t = 1:nlines;
for m=1:nlines
x(:,m) = t+m;
end
figure %plot all the lines in the default colors
h(1) = plot(t,x(:,1));
hold on