Friday, December 28, 2012

Line Smoothing for Matlab plot() command

The regular Matlab plot() command outputs curvy lines as if they are staircased due to the lack of proper antialiasing. A remedy for this is to use the hidden feature of line properties: LineSmoothing (plot(function,'LineSmoothing','on')). One example is shown below:

LineSmoothingDemo
clear all; clc;

% Simple example showing the Line Smoothing property

freq=1e6;        % frequency of operation
omega=2*pi*freq; % angular frequency
T=1/freq;        % period

Nt=10;
dt=T/Nt;

c=3e8;           % speed of light
lambda=c/freq;   % wavelength
k=2*pi/lambda;   % wavenumber

Nx=20;
dx=lambda/Nx;

x=(-6*lambda):dx:(6*lambda);

% Evaluate $$ f(x)= sin(\omegat-kx) $$ at t=0
func= sin(omega*0-k*x);

% Plot
figure(1); clf; set(gcf,'Color',[1 1 1]);
subplot(2,1,1);
plot(x,func,'-b'); hold on;
title('No Line Smoothing');
Xlim([x(1) x(end)])

subplot(2,1,2);
plot(x,func,'-r','LineSmoothing','on')
title('With Line Smoothing');
Xlim([x(1) x(end)])

For more information and other tips on Matlab, please refer to the following website: undocumentedmatlab.com

 

Tuesday, December 25, 2012

Green Point Ridge Hike

We started around 6.30 am to hike aiming to reach North Lake. By 9.30, had our breakfast and kept going. Almost one mile away from North Lake, decided to head back. The trail was full of snow after approximately 1500 ft. Nice view of Columbia Gorge can be seen. On a sunny day, this trail should be a terrific hike. Here is the hike log and some photos:

Green Point Ridge Hike
Snapshots:


Saturday, December 15, 2012

Nesmith Point Hike

We started around 6.30 am for the hike. Hiked uphill until 9.30 and stopped to have the breakfast. Then started our descent. Trail was full of snow after 1500 ft.
 



Monday, December 10, 2012

Wahclella Falls - Highway State Trail Hike

Wahclella Falls - Highway State Trail




Snapshots:
Our GPS log overlayed on Google Earth: