% setup2p1.m - skeleton for Activity 2 in Computer Lab 5 % Philip D Loewen, 2013-10-31 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Initialization: Define time nodes of interest %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% tmax = 1; tvalues = linspace(0,tmax,201); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Calculation: Replace with more interesting forms! %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% xvalues = zeros(size(tvalues)); vvalues = zeros(size(tvalues)); %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Plotting: Focus on the "and draw" parts below %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Create a new figure: ComponentFigureHandle = figure('Name','Component Trajectories'); title('Component Trajectories [Justin Bieber]'); % Create the upper subplot: StateAxesHandle = subplot(2,1,1); xlabel('time, t'); ylabel('state, x'); hold on; grid on; % Create the lower subplot: VelocityAxesHandle = subplot(2,1,2); xlabel('time, t'); ylabel('velocity, v'); hold on; grid on; % Shift focus to *state* axes and draw on them: axes(StateAxesHandle); % Replace this line with some plotting commands % Shift focus to *velocity* axes and draw on them: axes(VelocityAxesHandle); % Replace this line with some plotting commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Extensions: Compute different curves here. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%