Defining and plotting a non-parametric function
Code: "func_nonparametric1.py". Programming language: Python
DMelt Version 1. Last modified: 12/11/2015. License: Pro
https://datamelt.org/code/cache/func_nonparametric1_3878.py
To run this script using the DMelt IDE,
copy the above URL link to the menu [File]→[Read script from URL] of the DMelt IDE.
from java.lang import Math
from jhplot import *
class MyFunc(FNon):
def value(self, x):
y=x[0]*x[0]*Math.sqrt(x[0])
if (x[0]<3): y=0
return y
c1 = HPlot() # plot data and the fit function
c1.visible(); c1.setAutoRange()
pl = MyFunc("Title",1,0) # assume 1 variable, 0 parameters
f1=F1D(pl,0,10) # convert to plottable function (0-10)
c1.draw(f1)
You see the box below because you did not login.