フィルターのクリア

How do I export spectral data generated in Time Series Tools to the MATLAB workspace or to a file?

2 ビュー (過去 30 日間)
I am using Time Series Tools (>>tstool ) in MATLAB. I would like to export the spectral data generated from a time series data set when creating a spectral plot. My target is the workspace or a file.
I can do this with the time series data itself, but cannot seem to do it with spectral data.

採用された回答

MathWorks Support Team
MathWorks Support Team 2010 年 1 月 21 日
The ability to export spectral data to the MATLAB workspace or a file is unavailable in MATLAB 7.1 (R14SP3).
A workaround is to access the API of the Time Series Tools GUI, as follows.
Once the spectral plot is generated, click on Spectral View in the session tree and then call the following function from the MATLAB command line.
>> s = exportSpecData
This function EXPORTSPECDATA can be created as follows:
s = function exportSpecData
h = tstool;
n = h.TreeManager.getselectednode;
for k=1:length(n.Plot.Waves)
s(k).Name = n.Plot.Waves(1).Name;
s(k).Frequency = n.Plot.Waves(1).Data.Frequency;
s(k).Spectrum = n.Plot.Waves(1).Data.Response;
end
Notes:
1. This function accesses the API of the Time Series Tools, and this API is subject to change in future releases of MATLAB. Consequently, this method is not supported.
2. The Spectral View item must be selected in Time Series Tools before the exportSpecData function is called. Otherwise, an error will be produced. Select Time Series Session Tree --> Views --> Spectral Plots --> View1, and then call the function.
The code above is available in the attached file, 'exportSpecData.m'.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpectral Measurements についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by