saving to cell2mat without overwriting

I am fitting data (each column ) to linear function in a loop
I would like to save output result (gof) to a matrix , each loop different column without overwritin.
Can anyone help?
x = B(:,2)
for i=3: length(B)
y = B(:,i)
[fitresult, gof] = createFit(x, y)
A=cell2mat(struct2cell(gof))
end

 採用された回答

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH 2019 年 12 月 5 日

0 投票

x = B(:,2)
A=[];
for i=3: length(B)
y = B(:,i)
[fitresult, gof] = createFit(x, y)
A=[A cell2mat(struct2cell(gof))]
end

1 件のコメント

EK
EK 2019 年 12 月 5 日
great! thanks a lot

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeLoops and Conditional Statements についてさらに検索

製品

リリース

R2018a

質問済み:

EK
2019 年 12 月 5 日

コメント済み:

EK
2019 年 12 月 5 日

Community Treasure Hunt

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

Start Hunting!

Translated by