Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

matlab - Curve fitting without toolbox -


without curve fit toolbox how fit function data in matlab?

in particular, how fit function isn't polynomial, e.g., if want fit function y = x^(1/3) + 5 not integer?

if know form of function want fit not know parameters, can use fminsearch find parameters fit data. if have data (possibly noisy) want fit y=x^a + bwhere aand bare unknown (here assume true values a=1/3 , b=5) how i'd have quick answer:

here generate data (you not have in real life case)

>> x = linspace(0,5,10); >> y = x.^(1/3) + 5; >> y_noisy = y + 0.1*rand(size(y));  

then define function want minimize respect a , b , minimize fminsearch. in case, minimize integral of square of difference between data , function used fit. below have defined 2 functions, 1 noisy data, , 1 without noise. see in absence of noise recover values of aand b.

nb: fminsearch wotks vector of parameters (v in case). took a=v(1)and b=v(2). have provide initial guess v(here [1 1]).

>> err_noisy  = @(v) trapz(x,(y_noisy - x.^v(1)-v(2)).^2); >> err = @(v) trapz(x,(y - x.^v(1)-v(2)).^2);  >> v_noisy = fminsearch(err_noisy,[1 1])  v_noisy =      0.3345    5.0594  >> v = fminsearch(err,[1 1])  v =      0.3333    5.0000 

last comment, in cases have constraints on values of aand bit useful perform change of variable. example if know a>0, might want identify log(a) , convert identified value a.

hope helps.

a.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -