Skip to content

Instantly share code, notes, and snippets.

View adamjgnoel's full-sized avatar

Adam Noel adamjgnoel

View GitHub Profile
myMean = 2; % RV mean
myVariance = 3; % RV variance
myLength = 100; % Length of random vector
myOutput = myMean + sqrt(myVariance)*randn(1,myLength);
function myOutput = my_simulation_function(myMean, myVariance, myLength)
myOutput = myMean + sqrt(myVariance)*randn(1,myLength);
myMean = 2; % RV mean
myVariance = 3; % RV variance
myLength = 100; % Length of random vector
myOutput = my_simulation_function(myMean, myVariance, myLength);
function myOutput = my_simulation_function2(myMean, myVariance, myLength)
% Sample function that saves output to a custom file.
myOutput = myMean + sqrt(myVariance)*randn(1,myLength);
save(['my_simulation_output_mean_' num2str(myMean) '_var_' num2str(myVariance) '_length_' num2str(myLength)]);
myMean = -5:5; % RV mean
myVariance = 3; % RV variance
myLength = 100; % Length of random vector
for i = 1:length(myMean)
for j = 1:length(myVariance)
for k = 1:length(myLength)
my_simulation_function2(myMean(i), myVariance(j), myLength(k));
end
end
% Plotting take 1
x = 1e-2:1e-2:100;
% Smooth curves
y1 = exp(-x);
y2 = 1-exp(-x);
% Noisy curves
n = length(x);
% Plotting take 2
x = 1e-2:1e-2:100;
% Smooth curves
y1 = exp(-x);
y2 = 1-exp(-x);
% Noisy curves
n = length(x);
% Plotting take 3
x = 1e-2:1e-2:100;
% Smooth curves
y1 = exp(-x);
y2 = 1-exp(-x);
% Noisy curves
n = length(x);
% Plotting take 4
numPlotPoints = 50;
x = 1e-2:1e-2:100;
% Smooth curves
y1 = exp(-x);
y2 = 1-exp(-x);
numPlotPoints = 50;
x = 1e-2:1e-2:100;
% Smooth curves
y1 = exp(-x);
y2 = 1-exp(-x);
% Noisy curves