What is cause of my timeseries data assignment error please

1 次查看(过去 30 天)
NaN should correspond with data type single but isn't accepted - see below. -------------------------------------------------
>> get(t.Force_01) % produces answer below
ans =
Events: []
Name: 'Force_01'
UserData: []
Data: [90750x3 single]
DataInfo: [1x1 tsdata.datametadata]
Time: [90750x1 double]
TimeInfo: [1x1 tsdata.timemetadata]
Quality: []
QualityInfo: [1x1 tsdata.qualmetadata]
IsTimeFirst: 1
TreatNaNasMissing: 1
Length: 90750
------------------------------------------------------
>> t.Force_01.Data(81812,3)=NaN %produces error below
Subscripted assignment between dissimilar structures.
Error in tscollection/setts (line 157)
this.Members_(I(1)) = x;
Error in tscollection/subsasgn (line 9)
varargout{1} = setts(h,thists,S(1).subs);
------------------------------------------------------
NOTE
>> t.Force_01.Data(81812,3) % this shows the structure is nothing special
ans =
-1.4650
------------------------------------------------------
The assignment works with small example below even though structures are the same as timeseries 't' (I think).
------------------------------------------------------
A = timeseries([1:3; 4:6],'Name','A');
B = timeseries([7:9; 10:12],'Name','B');
tscAB = tscollection({A B}, 'name', 'tscAB');
clear A B;
tscAB.A.Data(1,1)=NaN;
-------------------------------------------------------

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Time Series 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by