Extract data from matlab default plots

I have this code that plots the response of a structure to an excitation signal. MATLAB has two functions that do the work, as you may see in my code that I am using those function (modalfrf and modalfit). I want to extract the data in those plots and re-plot them against other variables. My question is "How can I extract the x-axis and y-axis data from those default plots?"
I have attached my code along with two .mat files that are needed to run the code.
Fs = 4000
modalfrf(ex_signal(1:1024) ,ACC,Fs,1000);
[frf,fff] = modalfrf(ex_signal(1:1024),ACC,Fs,1000);
modalfit(frf,fff,Fs,15,'FitMethod','lsrf');

4 件のコメント

Image Analyst
Image Analyst 2019 年 2 月 10 日
Why do you need to extract them from the plot when you still have the original data?
If you did, I believe you can ask the axes for the xdata and ydata properties.
Ahmed Alsaadi
Ahmed Alsaadi 2019 年 2 月 10 日
MATLAB functions process the data, the output of (modalfrf and modalfit) is different from the input. I need to extract the output of those functions. I tried findobj but it didn't work.
Image Analyst
Image Analyst 2019 年 2 月 10 日
Did you try
ax = gca;
xdata = ax.XData;
or something like that?
Ahmed Alsaadi
Ahmed Alsaadi 2019 年 2 月 10 日
Yes, I tried it but I got an error that says
"No appropriate method, property, or field 'XData' for class 'matlab.graphics.axis.Axes'."

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

 採用された回答

Star Strider
Star Strider 2019 年 2 月 10 日

0 投票

Call it with as many outputs as you need, then use the outputs in your subsequent calculations:
[frf,f,coh] = modalfrf(___)
You can also plot the outputs, or call modalfit separately without outputs to do the plot you want.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeSpecifying Target for Graphics Output についてさらに検索

質問済み:

2019 年 2 月 10 日

回答済み:

2019 年 2 月 10 日

Community Treasure Hunt

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

Start Hunting!

Translated by