depecheSoul
depecheSoul

Reputation: 956

Octave, plotting function with one changing variable on two places

I am new in Octave but I would like to plot a function that has a same changing variable on two places.

The function looks like x/(x+2).

When one x changes the other one should have the same values as the other one.

Thanks for you help.

Upvotes: 0

Views: 162

Answers (1)

IKavanagh
IKavanagh

Reputation: 6187

Use fplot

>> fplot(@(x) x ./ (x + 2), limits);

limits is a vector of 2 elements containing the limits of x that you would like to plot the function between.

Upvotes: 2

Related Questions