How to recover the Data (fields) from the Structure

5 次查看(过去 30 天)
I am running a glmfit model in a loop and I want to recover the data stored in a structure as fields. The model is:
for j=1:length(gnames) t = (n==gnames(j)); [beta(:,j),dev(:,j), stat(:,j)] = glmfit([x1(t) x2(t)],y(t,:),'gamma', 'link', 'reciprocal', 'const','on'); end
Several 'stat' structures are genereted and I want to recover all dispersion paramters stored in stat.sfit field and I am stack.
I also want to use glmval to get the intervals of y. Any practical help will be appreciated

回答(1 个)

Sarah Wait Zaranek
Sarah Wait Zaranek 2011-4-28
allstats = [stat.sfit]
should save all the outputs in an array for you.
diff(yfit)
should give you the intervals of y (if I am understanding what you want), to get yfit - you use glmval as you mentioned above.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by