How to create a function with vectors and vertical asymptote using MATLAB -


plot function f(x) = 1.5x / x-4 -10 equal or less x equal or less 10. notice function have vertical asymptote @ x = 4. plot function creating 2 vectors domain of x. first vector (call x1) elements -10 3.7, , second vector (calle x2) elements 4.3 10. each of x vector create y vector (call them y1 , y2) corresponding values of y according function. plot function make 2 curves in same plot (y1 vs. x1 , y2 vs. x2).

learn how create vectors in matlab. first @ colon(:) operator, creates vectors, if know start, step , end values. @ linspace function, if don't need know how far points in vector are, how many points need. create vectors x1 , x2.

then learn how arithmetic calculations in matlab. create vectors y1 , y2.

then create plot plot function. may need use hold on, hold off draw 2 curves on same figure.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -