Docsity

Homework Assignment 2 for CVEN 302: Plotting Three Sets of Data, Assignments of Civil Engineering

Toggle sidebar
bg1
Homework Assignment 2
The program is defined as:
function Assignment3
% Assignment2 The program does homework assignment 2 for CVEN 302
%
% Synopsis: Creates a plot of three sets of data
%
% Input: No input values
%
% Output: plot of the data sets
t = linspace(-4*pi,4*pi,50);
y1 = sin(3*t/2);
y2 = cos(5*t/3);
y3 = y1.*y1 + 3*y1.*y2 - y2.*y2.*y2;
plot(t,y1,'gs--',t,y2,'r*-',t,y3,'+-');
axis([-15 15 -5 5]);
legend('y1','y2','y3');
xlabel('X values');
ylabel('Y values');
title('Homework Assignment 2');
The plot is results of the program showing the data sets

Partial preview of the text

Download Homework Assignment 2 for CVEN 302: Plotting Three Sets of Data and more Assignments Civil Engineering in PDF only on Docsity!

Homework Assignment 2

The program is defined as:

function Assignment % Assignment2 The program does homework assignment 2 for CVEN 302 % % Synopsis: Creates a plot of three sets of data % % Input: No input values % % Output: plot of the data sets t = linspace(-4pi,4pi,50); y1 = sin(3t/2); y2 = cos(5t/3); y3 = y1.y1 + 3y1.y2 - y2.y2.y2; plot(t,y1,'gs--',t,y2,'r-',t,y3,'+-'); axis([-15 15 -5 5]); legend('y1','y2','y3'); xlabel('X values'); ylabel('Y values'); title('Homework Assignment 2');

The plot is results of the program showing the data sets