Skip to content

Instantly share code, notes, and snippets.

Avatar

Adam Noel adamjgnoel

View GitHub Profile
View latex_multi_version_example.tex
% 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
View matlab_plot_wrapper_use
clear;
numPlotPoints = 50;
x = 1e-2:1e-2:100;
% Smooth curves
y1 = exp(-x);
y2 = 1-exp(-x);
View matlab_plot_wrapper
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
View matlab_plot_take6
numPlotPoints = 50;
x = 1e-2:1e-2:100;
% Smooth curves
y1 = exp(-x);
y2 = 1-exp(-x);
% Noisy curves
View matlab_removeLegendLines
% 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
View matlab_plot_take5
numPlotPoints = 50;
x = 1e-2:1e-2:100;
% Smooth curves
y1 = exp(-x);
y2 = 1-exp(-x);
% Noisy curves
View matlab_plot_take4
% Plotting take 4
numPlotPoints = 50;
x = 1e-2:1e-2:100;
% Smooth curves
y1 = exp(-x);
y2 = 1-exp(-x);
View matlab_plot_take3
% Plotting take 3
x = 1e-2:1e-2:100;
% Smooth curves
y1 = exp(-x);
y2 = 1-exp(-x);
% Noisy curves
n = length(x);
View matlab_plot_take2
% Plotting take 2
x = 1e-2:1e-2:100;
% Smooth curves
y1 = exp(-x);
y2 = 1-exp(-x);
% Noisy curves
n = length(x);
View matlab_plot_take1
% Plotting take 1
x = 1e-2:1e-2:100;
% Smooth curves
y1 = exp(-x);
y2 = 1-exp(-x);
% Noisy curves
n = length(x);
You can’t perform that action at this time.