Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Rational Function (MATLAB)

Status
Not open for further replies.

47box

Newbie level 5
Joined
Jan 8, 2014
Messages
8
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
101
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 graph.PNG function.PNG
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

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
 

Simply your denominator is wrong in coding.
Surely confirm parenthesis.

y = (2*x.^4-x.^2+1)./(x.^2-4);
 

Attachments

  • 171102-221307.png
    171102-221307.png
    9.7 KB · Views: 175
Last edited:
  • Like
Reactions: 47box

    47box

    Points: 2
    Helpful Answer Positive Rating
That is it. Thank you.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top