47box
Newbie level 5
![Newbie level 5](/styles/images/ranks/blevel2.gif)
Hi,
I´ve been trying to plot a rational function to see the graph of it.
f(x) = (2x4-x2+1) / x2-4
From a book I´m following a graph is showed below :
![function.PNG function.PNG](https://www.edaboard.com/data/attachments/73/73993-893c0739e1534ce460e9ab8da0f5d5cc.jpg)
figure1
I created a script trying make a graph comes out.
I got a graph completely out of what we have in a image above from the book.
![my image.PNG my image.PNG](https://www.edaboard.com/data/attachments/73/73994-7913890d5c2cdadb7d598e4779b1cea0.jpg)
As we can see it pass the limits of -2 and 2.
How can I plot a graph and have the same as we have in the book (figure 1)?
I tried to see matlab materials and could not figure out how to do that.
Thanks in advance
I´ve been trying to plot a rational function to see the graph of it.
f(x) = (2x4-x2+1) / x2-4
From a book I´m following a graph is showed below :
![function graph.PNG function graph.PNG](https://www.edaboard.com/data/attachments/73/73992-8e4a7e573a11ba3a1823c17d5c8ff07e.jpg)
![function.PNG function.PNG](https://www.edaboard.com/data/attachments/73/73993-893c0739e1534ce460e9ab8da0f5d5cc.jpg)
figure1
I created a script trying make a graph comes out.
Code:
clear
clc
x =(-100:0.01:100);
y = ((2.*(x.^4))-(x.^2)+1)./(x.^2)-4;
plot(x,y),hold on
axis([-4 4 -50 50])
grid on
I got a graph completely out of what we have in a image above from the book.
![my image.PNG my image.PNG](https://www.edaboard.com/data/attachments/73/73994-7913890d5c2cdadb7d598e4779b1cea0.jpg)
As we can see it pass the limits of -2 and 2.
How can I plot a graph and have the same as we have in the book (figure 1)?
I tried to see matlab materials and could not figure out how to do that.
Thanks in advance