필터 지우기
필터 지우기

export data from fitresult

조회 수: 83 (최근 30일)
Cristina Totaro
Cristina Totaro 2021년 1월 29일
답변: Jiarui Kang 2022년 6월 29일
Hi,
I am new on Matlab, I hope that someone can help me.
I have to make the fit of several files. I generated the code and I was able to perform the fit of all these files simultaneously.
My problem is to export the results of each fit as single txt files, because I have then to extract specific values of the function to perform other analyses.
I hope I have been clear enough.
Thank you.
Cristina
  댓글 수: 2
Scott Ronquist
Scott Ronquist 2021년 1월 29일
Hello Cristina,
Are you using the fit command to create a fitobject? And you would like to save the output of fitobject to a text file? To do this you can use the diary function in MATLAB to store all results output to the command window in a text file. See Example below:
% load data
load census;
% fit data
f=fit(cdate,pop,'poly2');
% capture output in "myDiaryFile.txt"
diary myDiaryFile.txt
f
diary off
Please let me know if I am understanding your problem correctly, thanks!
Cristina Totaro
Cristina Totaro 2021년 2월 1일
Hi,
thank you very much for your reply.
Actually, I need to save only the values of the coefficients of the fuction (it is a poly3), not all the info, because I have to use these values to obtain some specific values of the fuction itself.
However, your suggestion is useful for another step of my process.
Thank you again.
Cristina

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

답변 (1개)

Jiarui Kang
Jiarui Kang 2022년 6월 29일
The data of a fitted curve can be extracted using feval function.
First right click on your fitted data in curve fitting tool box and save it in your workspace. Then use feval function to evaluate the value for inputs.
for example
x=[0:0.0005:0.16];
y=feval(fittedmodel,x);

카테고리

Help CenterFile Exchange에서 Entering Commands에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by