Restore data from curve fitting session

6 ビュー (過去 30 日間)
Yoav Romach
Yoav Romach 2014 年 3 月 1 日
編集済み: Yoav Romach 2014 年 3 月 2 日
Hey There, I've analyzed a lot of data, fitted a bunch of stuff to it, then saved my curve fitting session. I haven't saved the original data :(
Now when i open the curve fitting session everything is there, but I've found no way to extract my original data, I assume it should be possible, but I can't find out how, can anyone help?
What I really want to do is use the curve fitting "Generate Code" to play around with the figures to make them ready for an article I'm writing, but the "Generate Code" does not save the data itself and it requires it as an input.
Thanks,
Yoav
  2 件のコメント
Star Strider
Star Strider 2014 年 3 月 1 日
I don’t have the Curve Fitting Toolbox (redundant with Statistics and Optimization TBs) so I don’t know what it does, but if you saved a scatterplot of your data as a MATLAB figure, your data may still be there. See the core MATLAB documentation for details.
Otherwise, I can only offer you my sympathies.
Yoav Romach
Yoav Romach 2014 年 3 月 1 日
I can save it as figures as well, can you point me to the relevant documentation?

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

採用された回答

Matt J
Matt J 2014 年 3 月 1 日
I can save it as figures as well, can you point me to the relevant documentation?
Do you mean all of the data you want to recover is viewable in a plot? If so, just find the children of the plot axes that are line objects
h=findobj(gca,'Type','line');
and then extract their XData and YData, e.g.,
X=get(h,'XData')
Y=get(h,'YData');
  4 件のコメント
Matt J
Matt J 2014 年 3 月 2 日
Is it possible to do it to the curve fitting object directly? without plotting it?
If there is a way to extract the original xdata and ydata from the fit object, the online documentation hides it well.
I conjecture that the ydata is not even saved inside the object, only the xdata, needed for default plotting.
Yoav Romach
Yoav Romach 2014 年 3 月 2 日
編集済み: Yoav Romach 2014 年 3 月 2 日
Well, the ydata must be saved somewhere inside the object, as the fitting tool plots the original data as well. However, as you said, they took great measures to hide it, and it's not important, so never mind.
Thanks a lot!

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

その他の回答 (1 件)

Star Strider
Star Strider 2014 年 3 月 1 日
編集済み: Star Strider 2014 年 3 月 1 日
I looked through the Curve Fitting Toolbox online documentation and found prepareCurveData. That may actually be what you want. I can’t experiment with it, but it may allow you to export your data from the Curve Fitting Toolbox to save in a separate file.
For the MATLAB figure file documentation, see savefig, and ‘Tips’ near the end of the page for opening it again. (This is a core MATLAB function.)
I definitely wish you luck!
  3 件のコメント
Star Strider
Star Strider 2014 年 3 月 1 日
I consider this urgent enough to suggest you contact Support. I don’t have the Curve Fitting Toolbox, so I can’t experiment with solutions. I jumped in because I want to be sure you don’t lose your data. As long as your data are safe inside your project, you can probably still recover them.
Please, next time, save your data to a ‘.txt’ or spreadsheet file first!
Yoav Romach
Yoav Romach 2014 年 3 月 1 日
Well, actually, I have most of my data, only a small part is missing... I actually thought it would be really easy and someone would give me an answer real quick, as the data is simply there!
Thanks a lot for your help, I'll figure out a way!

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

カテゴリ

Help Center および File ExchangeGet Started with Curve Fitting Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by