MATLAB Answers

What is cause of my timeseries data assignment error please

1 view (last 30 days)
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);
>> t.Force_01.Data(81812,3) % this shows the structure is nothing special
ans =
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;

Answers (0)

Community Treasure Hunt

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

Start Hunting!

Translated by