{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CEE 15 Introduction to Computing for Civil Engineers 5 - Plotting Capabilities

# CEE 15 Introduction to Computing for Civil Engineers 5 - Plotting Capabilities

This preview shows pages 1–4. Sign up to view the full content.

CEE 15 Introduction to Computing for Civil Engineers 38 Chapter 5 Plotting Capabilities 5.1. X – Y Plot Our objective is to generate x-y plot from data stored in 2 vectors. x = time, s y = temp, ° F 0 54.2 1 58.5 2 63.8 3 64.2 There are 3 ways to read this data. The data can be read explicitly. For example, x=[0 1 2 3]; y=[54.2 58.5 63.8 64.2]; disp(x); disp(y); plot(x,y),... title('Temperature Measurement'),... xlabel('time, s'),... ylabel('temp, °F'),... grid will give the following output in the command window: 0 1 2 3 54.2000 58.5000 63.8000 64.2000 and the following figure in the graphic window: The data can be read using the user input. For example consider the following program: x=input('give the values of time'); y=input('give the values of temperature'); disp(x); disp(y); plot(x,y),... title('Temperature Measurement'),... xlabel('time, s'),... ylabel('temp, °F'),...

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document