Timetable same size error, but are same size

27 Views Asked by At

I have data from three different timelines (from two different times of different days) and my goal ist to use tfest later to estimate a transfer function. Therefor i have to make them the same length and ideally give them a new timeline so I can plot them later in one graph. Here is my take at it:

% Auffüllen der kürzeren Zeitachsen mit den letzten Werten
if length(timeline_1) < max_timeline
    zeitachse_1 = linspace(timeline_1(1), timeline_1(end), max_timeline);
    daten_1 = [daten_1; repmat(daten_1(end,:), max_timeline - length(daten_1), 1)];
end

if length(timeline_2) < max_timeline
    timeline_2 = linspace(timeline_2(1), timeline_2(end), max_timeline);
    daten_2 = [daten_2; repmat(daten_2(end,:), max_timeline - length(daten_2), 1)];
end

if length(timeline_3) < max_timeline
    timeline_3 = linspace(timeline_3(1), timeline_3(end), max_timeline);
    daten_3 = [daten_3; repmat(daten_3(end,:), max_timeline - length(daten_3), 1)];
end

% Erstellen von neuen Timetables mit den modifizierten Zeitachsen und Daten
T_1 = timetable(timeline_1, daten_1(:, 1), daten_1(:, 2), daten_1(:, 3));

The result is this:

>> length(daten_1(:,1))

ans =

      113997

>> length(daten_1(:,2))

ans =

      113997

>> length(daten_1(:,3))

ans =

      113997

>> length(timeline_1)

ans =

      113997

Yet I get this error:

Error using timetable (line 317)
All table variables must have the same number of rows.

Error in test (line 135)
T_1 = timetable(timeline_1, daten_1(:, 1), daten_1(:, 2), daten_1(:, 3));

Does anyone have an idea?

0

There are 0 best solutions below