MATLAB Answers

saving to cell2mat without overwriting

3 views (last 30 days)
EK
EK on 5 Dec 2019
Commented: EK on 5 Dec 2019
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

  0 Comments

Sign in to comment.

Accepted Answer

JESUS DAVID ARIZA ROYETH
JESUS DAVID ARIZA ROYETH on 5 Dec 2019
x = B(:,2)
A=[];
for i=3: length(B)
y = B(:,i)
[fitresult, gof] = createFit(x, y)
A=[A cell2mat(struct2cell(gof))]
end

  1 Comment

Sign in to comment.

More Answers (0)

Sign in to answer this question.

Products


Release

R2018a