How to recover the Data (fields) from the Structure

7 visualizaciones (últimos 30 días)
Peter
Peter el 28 de Abr. de 2011
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

Respuestas (1)

Sarah Wait Zaranek
Sarah Wait Zaranek el 28 de Abr. de 2011
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