MATLAB Answers

Ross
0

What is cause of my timeseries data assignment error please

Asked by Ross
on 11 Jan 2013
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 Comments

Sign in to comment.

0 Answers