Class Notes (1,100,000)
US (480,000)
UCSD (8,000)
MAE 08 (30)
Lecture 6

MAE 08 Lecture 6: MAE 8 Lec 6


Department
Mechanical and Aerospace Engineering
Course Code
MAE 08
Professor
Hieu Tan Pham
Lecture
6

This preview shows half of the first page. to view the full 2 pages of the document.
axis([-12 12 0 120])
axis([xmin xmax ymin ymax])
clear; close all; clc;
x = 2*pi*[-1:0.1:1];
y1 = sin(x);
y2 = cos(x);
figure(1), hold on
plot(x,y1,'-ko','LineWidth',4,'MarkerSize',12,'MarkerFaceColor','r');
plot(x,y2,'--r*');
xlabel('x');
ylabel('y');
title('Plot demo');
axis tight;
clear; close all; clc;
%% Display welcome message:
disp('This program extracts rainfall data in San Diego');
disp('from 1850 to 2012.');
%% Ask for user's input:
year = input('Enter a year (1850-2012): ')
start_month = input('Enter the start month (1-12): ');
end_month = input('Enter the end month (1-12): ');
file_name = input('Enter a file name: ','s');
%% Load rainfall data and extract subdata:
load('rainfall.dat')
rain_data = rainfall(year-1850+1,start_month+1:end_month+1);
month = [start_month:end_month];
You're Reading a Preview

Unlock to view full version