Then I define the function I want to minimize with respect to a and b and minimize it with fminsearch. Here I generate my data (you would not have to do that in a real life case) > x = linspace(0,5,10) If you have data (possibly noisy) that you want to fit to y=x^a + bwhere aand bare unknown (here I will assume that the true values are a=1/3 and b=5) this is how I'd have a quick answer: If you know the form of the function you want to fit but do not know its parameters, you can use fminsearch to find the parameters that would fit your data.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |