% % ERTH 135 Lab 3, Spring 2008 % clear % % Problem 1) Blackbody Radiation % constants % c = 2.99e8; % speed of light [m/s] h = 6.63e-34; % Planck's constant [J s] k = 1.38e-23; % Boltzmann's constant [J/K] A = 2.898e-3; % Wein's Law constant [K m] T = 300; % Temperature [K] lam = logspace(-8,1,100); % wavelength [m] % % Plank's Law % % % Wein's Law % % % Problem 2) La Jolla Topography % % load the topography image into matlab % fid=fopen('lajolla_swab','r'); topo=fread(fid,[3240,1440],'int16')'; % % image the topography % % % illuminate the topography % % % Problem 3) RGB image % % read in a jpg image % z=imread('Paraglider.jpg'); size(z) % % separate out the red, blue, and green components % r=z(:,:,1); % % look at the components % figure(6),clf subplot(2,2,1),imshow(z),title('composite') subplot(2,2,2),imshow(r),title('red') % % recombine components % figure(7),clf subplot(2,2,1),imshow(cat(3,r,b,g)),title('r,b,g') % % write an image to a jpg file % outimage=cat(3,g,r,b); imwrite(outimage,'ParaGRB.jpg')