필터 지우기
필터 지우기

How to export coefficients automatically when using rstool?

조회 수: 3 (최근 30일)
Daixin
Daixin 2013년 7월 31일
댓글: Rafael Schwarzenegger 2018년 10월 2일
Here are part of codes in my M file:
X=[75 0.1;
100 0.1;
125 0.1;
100 0.08;
100 0.12];
Y=[1.04
0.98
1.34
1.05
1.11 ]
Rstool(X,Y,'purequadratic');
What I want to do is: Obtaining coefficients automatically and store them in a named vector, then this vector will be used to as later calculation in the M file.
Currently, to obtain coefficients, I have to click "Export" button after rstool, which is not what I want.
I would like to ask for your help, thank you so much!
Best regards,
Daixin

채택된 답변

Wayne King
Wayne King 2013년 7월 31일
편집: Wayne King 2013년 7월 31일
Hi, you can just use regstats()
stats = regstats(Y,X,'purequadratic');
stats.beta
The beta field of the structure array stats contains the coefficients.
The r field contains the residuals
stats.r
  댓글 수: 2
Daixin
Daixin 2013년 7월 31일
Hi Wayne,
It works!! Thank you so much!
regards,
DAIXIN
Rafael Schwarzenegger
Rafael Schwarzenegger 2018년 10월 2일
Where are the names of the coefficients (+quadratic coefficients)? Thank you very much.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

Community Treasure Hunt

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

Start Hunting!

Translated by