MATLAB GRAPHICS
PHILOSOPHYA picture, it is said, is worth a thousand words.Graphics ki duniyan me swagat hai!!!!Hum log 2d 3d plots ki kuc...
Basic 2d graphicsTry thisplot(rand(1,20))Most common format is plot(x,y) where x and y are nothing butVectors of same leng...
Another form of plot to draw a line between two points:coordinates (0, 1) and (4, 3)plot([0 4], [1 3])Also has set of easy...
Labelsgtext(‘x marks the spot’)Try with me!Try to explore figure menus like insertgridtitle(’text’)xlabel(’horizontal’)yla...
Multiple plots on same axis:holdplot(rand(1,20))plot(rand(1,17))hold offIf you are plotting two graphs on the same axes yo...
plot(0, 0, o)   plot(x,sin(x), x, cos(x), ‘m’)    plots sin (x) in the default style and color and cos (x) with   circles ...
Axis limitsaxis( [xmin, xmax, ymin, ymax] )Go home try to find out on internet abt other axis commandsMultiple plots in fi...
Logarithmic plots:   x = 0:.01:4;  semilogy(x, exp(x)), gridTry to find out info on semilogxPolar plotspolar(theta, r)x = ...
Plotting rapidly changing mathematical functionx = 0.01:.001:.1;plot(x, sin(1./x)).001 ki jagah .0001 daliye graphs signif...
3 d plotsplot3(x, y, z)  draws a 2-D projection of a line in 3-D through the points  whose coordinates are the elements of...
Mesh surfacesz =x^2 –y^20<=x<=5 and 0<=y<=5[x,y] =meshgrid(0:5)z = x.^2 - y.^2mesh(x,y,z)Now typesurf(x,y,z)See what happens
Matlab graphics
Upcoming SlideShare
Loading in …5
×

Matlab graphics

424 views

Published on

Published in: Education, Technology, Spiritual
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
424
On SlideShare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
14
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Matlab graphics

  1. 1. MATLAB GRAPHICS
  2. 2. PHILOSOPHYA picture, it is said, is worth a thousand words.Graphics ki duniyan me swagat hai!!!!Hum log 2d 3d plots ki kuch jankari lene ki koshish karengePer for further information u shud chk the help part in MATLAB
  3. 3. Basic 2d graphicsTry thisplot(rand(1,20))Most common format is plot(x,y) where x and y are nothing butVectors of same length.Axes are automatically scaled and drawn to include theminimum and maximum data points.Eg of vectors of same length:x = 0:pi/40:4*pi;plot(x, sin(x))
  4. 4. Another form of plot to draw a line between two points:coordinates (0, 1) and (4, 3)plot([0 4], [1 3])Also has set of easy to use plot commands called ezplotEg ezplot(‘tan(x)’) ezplot(‘cos(x)) ezplot(‘x^2’)
  5. 5. Labelsgtext(‘x marks the spot’)Try with me!Try to explore figure menus like insertgridtitle(’text’)xlabel(’horizontal’)ylabel(’vertical’)
  6. 6. Multiple plots on same axis:holdplot(rand(1,20))plot(rand(1,17))hold offIf you are plotting two graphs on the same axes you may findplotyy useful—it allows you to have independent y-axis labelson the left and the right, e.g.plotyy(x,sin(x), x, 10*cos(x))(for x suitably defined).
  7. 7. plot(0, 0, o) plot(x,sin(x), x, cos(x), ‘m’) plots sin (x) in the default style and color and cos (x) with circles joined with dashes in magenta. The available colors are denoted by the symbols c, m, y,k, r, g, b, w. You can have fun trying to figure out what they mean, or you can use help plot to see the full range of possible symbols.
  8. 8. Axis limitsaxis( [xmin, xmax, ymin, ymax] )Go home try to find out on internet abt other axis commandsMultiple plots in figure
  9. 9. Logarithmic plots: x = 0:.01:4; semilogy(x, exp(x)), gridTry to find out info on semilogxPolar plotspolar(theta, r)x = 0:pi/40:2*pi;polar(x, sin(2*x)),grid
  10. 10. Plotting rapidly changing mathematical functionx = 0.01:.001:.1;plot(x, sin(1./x)).001 ki jagah .0001 daliye graphs significantly alag haiInstead of this use fplotfplot(sin(1/x), [0.01 0.1])
  11. 11. 3 d plotsplot3(x, y, z) draws a 2-D projection of a line in 3-D through the points whose coordinates are the elements of the vectors x, y and z. For example, the command z-axisplot3(rand(1,10), rand(1,10), rand(1,10))generates 10 random points in 3-D space, and joins them withLines.
  12. 12. Mesh surfacesz =x^2 –y^20<=x<=5 and 0<=y<=5[x,y] =meshgrid(0:5)z = x.^2 - y.^2mesh(x,y,z)Now typesurf(x,y,z)See what happens

×