From: Armin Mueller on 10 May 2010 14:57 Dear NG, I would like to fit a number of vectors p and y. They have different lengths, so they are stored in cells. Now, how can I store the individual results? Obviously, this example doesn't work since the result "cf" is of type "cfit". "gof" and "out" are structures which is OK. for idx = 1:100 [cf(idx), gof(idx), out(idx)] = fit(y{idx}, p{idx}, fittype('gauss1')); end Do I have to build a cell array of type "cfit"? How to do this?! Thank you for any hint! Armin
From: Steven Lord on 10 May 2010 17:10 "Armin Mueller" <arm.in(a)web.de> wrote in message news:hs9kud$o3o$1(a)news2.rz.uni-karlsruhe.de... > Dear NG, > > I would like to fit a number of vectors p and y. They have different > lengths, so they are stored in cells. Now, how can I store the individual > results? Obviously, this example doesn't work since the result "cf" is of > type "cfit". "gof" and "out" are structures which is OK. > > for idx = 1:100 > [cf(idx), gof(idx), out(idx)] = fit(y{idx}, p{idx}, > fittype('gauss1')); > end > > Do I have to build a cell array of type "cfit"? How to do this?! Basically the same way you created p and y. cf = cell(1, 100); gof = cell(1, 100); out = cell(1, 100); for idx = 1:100 [cf{idx}, gof{idx}, ... end -- Steve Lord slord(a)mathworks.com comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
From: Armin Mueller on 11 May 2010 17:36 Steven Lord wrote: >> Do I have to build a cell array of type "cfit"? How to do this?! > > Basically the same way you created p and y. > > cf = cell(1, 100); >[...] This was almost too easy. I'm feeling ashamed. Thank you Steven! ;-) Armin
|
Pages: 1 Prev: Subplot.imshow,size of images Next: Rolling structure actuated by spring in Simmechanics |