[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
How to plot a function (graph)?
From: |
Robb Bean |
Subject: |
How to plot a function (graph)? |
Date: |
Fri, 5 May 2006 16:59:35 +0200 |
Hi!
Yesterday I started programming in Octave using a Matlab tutorial which
was very helfull, I did not expect Octave to be so close to the
"original". But I missed a function for plotting a function graph;
Matlab contains the fplot function, which does not exist in Octave.
Here is what I had to code:
__gnuplot_plot__(['[x=0:1] ', num2str(a), '*x*(1-x)'])
The Matlab way of doing this should be something like this:
% a is a global variable
function ret = f(x)
ret = a*x*(1-x)
endfunction
fplot(@f, [0 1])
(See
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/fplot.html
for details.) Did I miss something or is there really no fplot
equivalent in Octave?
Yours,
--
Robb Bean <Robb underline Bean at gmx dot net>
Projects:
http://applaunch.sourceforge.net/
http://laymansys.sourceforge.net/
- How to plot a function (graph)?,
Robb Bean <=