Last active
August 29, 2015 13:57
-
-
Save miura/9912494 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Curve fitting example | |
// see class CurveFitter | |
// http://rsb.info.nih.gov/ij/developer/api/ij/measure/CurveFitter.html | |
// 20110412 Kota | |
//creat example data arrays | |
var xa = [1, 2, 3, 4]; | |
var ya = [3, 3.5, 4, 4.5]; | |
//construct a CurveFitter instance | |
cf = CurveFitter(xa, ya); | |
//actual fitting | |
//fit models: see http://rsb.info.nih.gov/ij/developer/api/constant-values.html#ij.measure.CurveFitter.STRAIGHT_LINE | |
cf.doFit(CurveFitter.STRAIGHT_LINE); | |
//print out fitted parameters. | |
IJ.log(cf.getParams()[0]+ " : " + cf.getParams()[1]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment