Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Apr 2017 |
Last Sign in: | 12 Weeks Ago, 4 Days Ago |
Questions Answered: | 4870 |
Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Use plot to graph data/functions
x = 0 : 0 . 2 : 1 0 ; % 51 values 0 , 0 . 2 , 0 . 4 , 0 . 6 , . . . , 1 0 . 0
f = @( x ) x . * sin ( x ) . / ( 1 + x ) ; % i n l i n e func tion
% note . * and . / f o r componentwise * and /
y = f ( x ) ; % evaluate f at l i s t x
p l o t ( x , y ) ; % graph y data vs x data
p l o t ( x , y , ’ o ’ ) ; % use marker o without connecting points
z = sin ( x ) ; % evaluate sin at x values
p l o t ( x , y , ’ o ’ ,x , z ) ; % superpose 2 plots
T = [ x ; y ] ; % 2x51 matrix with x in row 1 and y in row 2
p l o t (T ( 1 , : ) , T ( 2 , : ) ) ; % p l o t 2nd row of T vs 1 s t row
It is also possible to do more sophisticated types of plots in MATLAB,
including polar coordinates, three-dimensional surfaces, contour plots, . . .
Â
MAT 343 Laboratory 2Linear transformations and computer animationin MATLABBruno D. WelfertSchool of Mathematical & Statistical Sciences
Attachments:-----------