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.

16 visualizaciones (últimos 30 días)
% % Plotting data from the .mat file
data = load('THPWM.mat')
sCell = struct2cell(data);
Array = [sCell{:}];
t= Array(:,1);
x= Array(:,2);
plot(t,x);

Respuesta aceptada

darova
darova el 15 de Ag. de 2021
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)

Más respuestas (0)

Categorías

Más información sobre Structures en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by