how to plot 1x1 struct timeseries having field names cell 1x1 array? The .mat file is a time series data with 3 columns of data with respect to time.

27 ビュー (過去 30 日間)
% % Plotting data from the .mat file
data = load('THPWM.mat')
sCell = struct2cell(data);
Array = [sCell{:}];
t= Array(:,1);
x= Array(:,2);
plot(t,x);
  2 件のコメント
ragnor
ragnor 2021 年 8 月 15 日
@darova: I have attached the .mat file. I am sorry i forgot to add it earlier.

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

採用された回答

darova
darova 2021 年 8 月 15 日
Extrac the data and plo
% % Plotting data from the .mat file
data = load('THPWM.mat');
fieldnames(data)
ans = 1×1 cell array
{'ans'}
data.ans
timeseries Common Properties: Name: '' Time: [65486x1 double] TimeInfo: tsdata.timemetadata Data: [65486x3 double] DataInfo: tsdata.datametadata
x = data.ans.Data(:,1);
y = data.ans.Data(:,2);
z = data.ans.Data(:,3);
plot3(x,y,z)
  1 件のコメント
ragnor
ragnor 2021 年 8 月 15 日
編集済み: ragnor 2021 年 8 月 15 日
@darova: Thank you for your help. it was indeed very helpful.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by