How can I create a table from column from another table and some model output?
13 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
T4H14
am 18 Okt. 2017
Beantwortet: Peter Perkins
am 19 Okt. 2017
I have a table T that has a first column called "Dates" which contains the observation dates for input variables into a model and I run the model and generate output called "yfit1". How can I create a new table M which contains the Dates from T and the model output yfit1?
0 Kommentare
Akzeptierte Antwort
Cam Salzberger
am 18 Okt. 2017
Bearbeitet: Cam Salzberger
am 18 Okt. 2017
Something like this:
% Sample data
T = table(datetime('now')+(0:2).', rand(3,1), ...
'VariableNames', {'Dates', 'Something'});
yfit1 = rand(3,1);
% Create new table
M = table(T.Dates, yfit1, 'VariableNames', {'Dates', 'Fit'});
-Cam
0 Kommentare
Weitere Antworten (1)
Peter Perkins
am 19 Okt. 2017
It may be that you don't want to create a new table. If the dates are all the same, then it seems like there's a 1:1 correspondence between inputs and outputs. Why not just add a new variable to your existing table? Better yet, create a timetable containing your inputs and output(s).
0 Kommentare
Siehe auch
Kategorien
Mehr zu Tables finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!