How to recover the Data (fields) from the Structure

1 回表示 (過去 30 日間)
Peter
Peter 2011 年 4 月 28 日
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.

カテゴリ

Help Center および File ExchangeText Files についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by