Created
June 23, 2016 18:30
-
-
Save adamjgnoel/7483568bf8b73bb2bc411221c54de5f2 to your computer and use it in GitHub Desktop.
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 | |
n = length(x); | |
z1 = y1.*(1+0.005*randn(1,n)); | |
z2 = y2.*(1+0.005*randn(1,n)); | |
plotInd = unique(floor(logspace(0, log10(n), numPlotPoints))); | |
hFig = figure; | |
hAxes = axes('Parent',hFig,... | |
'FontSize',12,'XGrid','on', 'YGrid','on', 'Box', 'on',... | |
'TickLabelInterpreter', 'latex'); | |
set(hFig, 'Color', 'w') | |
hold('on'); | |
plot(hAxes, NaN,NaN,'LineStyle', '-', 'Color', [0 0 0],... | |
'LineWidth', 1); | |
plot(hAxes, NaN,NaN,'LineStyle', 'none', 'Color', [0 0 0],... | |
'LineWidth', 1, 'Marker', 'o'); | |
plot(hAxes, x(plotInd),y1(plotInd),'LineStyle', '-', 'Color', [0 0 0],... | |
'LineWidth', 1); | |
plot(hAxes, x(plotInd),y2(plotInd),'LineStyle', '-', 'Color', [0 0 1],... | |
'LineWidth', 1); | |
plot(hAxes, x(plotInd),z1(plotInd),'LineStyle', 'none', 'Color', [0 0.6 0],... | |
'LineWidth', 1, 'Marker', 'o'); | |
plot(hAxes, x(plotInd),z2(plotInd),'LineStyle', 'none', 'Color', [1 0 0],... | |
'LineWidth', 1, 'Marker', 'o'); | |
xlabel('Time [s]', 'interpreter', 'Latex'); | |
ylabel('Exponential Observation', 'interpreter', 'Latex'); | |
legend(hAxes, 'Analytical', 'Simulation') | |
set(hAxes,'XScale','log'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment