This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Simple 2D Diffusion Simulation | |
% Created 19 May 2023 by Adam Noel | |
% Parameters | |
N = 2000; % Number of molecules | |
D = 1; % Diffusion coefficient [m^2/s] | |
dt = 1; % Time step [s] | |
RX = [9,11,9,11]; % Receiver | |
numRepeat = 10; % Number of realizations/repeats | |
rng(1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% This is a working example to demonstrate use of switches to maintain multiple | |
% versions of a single document | |
% | |
% Uses the IEEEtran class: https://www.ctan.org/pkg/ieeetran | |
% | |
% Created 2016-10-30 by Adam Noel | |
% Define the switch here using "newif" and start its name with "if" | |
% Here, NAME_OF_SWITCH == "OneCol" | |
\newif\ifOneCol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
clear; | |
numPlotPoints = 50; | |
x = 1e-2:1e-2:100; | |
% Smooth curves | |
y1 = exp(-x); | |
y2 = 1-exp(-x); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [hFig, hAxes, hCurve] = my_plot_function(hAxes, ... | |
xData, yData, myFigProp, myAxesProp, myCurveProp, xStr, yStr) | |
% A plotting wrapper function. Designed to plot one curve per call. | |
% | |
% INPUTS | |
% hAxes - handle to existing axes (set to 0 to create new figure and axes) | |
% xData - x data to plot (set to [] to not plot) | |
% yData - y data to plot (set to [] to not plot) | |
% myFigProp - structure of figure properties to change from defaults. See | |
% subfunction buildFigureStruct for defaults. Ignored if hAxes == 0. Set |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
numPlotPoints = 50; | |
x = 1e-2:1e-2:100; | |
% Smooth curves | |
y1 = exp(-x); | |
y2 = 1-exp(-x); | |
% Noisy curves |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% This script removes the selected lines from a figure's legend. The lines | |
% must be selected BEFORE calling this script | |
% | |
% Created June 6, 2014, by Adam Noel | |
% | |
function removeLegendLines() | |
a = findobj('Selected', 'on'); | |
for i = 1:length(a) | |
hasbehavior(a(i), 'legend', false); | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
numPlotPoints = 50; | |
x = 1e-2:1e-2:100; | |
% Smooth curves | |
y1 = exp(-x); | |
y2 = 1-exp(-x); | |
% Noisy curves |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Plotting take 4 | |
numPlotPoints = 50; | |
x = 1e-2:1e-2:100; | |
% Smooth curves | |
y1 = exp(-x); | |
y2 = 1-exp(-x); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Plotting take 3 | |
x = 1e-2:1e-2:100; | |
% Smooth curves | |
y1 = exp(-x); | |
y2 = 1-exp(-x); | |
% Noisy curves | |
n = length(x); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% Plotting take 2 | |
x = 1e-2:1e-2:100; | |
% Smooth curves | |
y1 = exp(-x); | |
y2 = 1-exp(-x); | |
% Noisy curves | |
n = length(x); |
NewerOlder