Create offset in one of the 2 datasets
Mostrar comentarios más antiguos
I have two files one .fig file and one .txt file
I know how to merge the two datasets. But how do I make an offset in time on the .txt file. I need to offset 6 sec and I have a log of each 2 mS
figfile = 'IBox 100-100 - Copy.fig';
datafile = 'V164_Backup_KK_Con_Test1_Step1_100_100_Rev1_removed_header.txt';
fig = openfig(figfile);
T = readtable(datafile,'Format','auto');
T1 =T;
T1.DCOUTPOWERKW = (T1.DCOUTV .* T1.DCOutA ./1000);
T1.VFDPOWERKW = (T1.VFDV .* T1.DCOutA./1000);
hold on
t = T1.TIME;
P = T1.Properties.VariableNames(2:end);
for K = 1 : length(P)
fn = P{K};
plot(t, T1.(fn), 'DisplayName', fn);
end
hold off
set(gcf, 'visible', 'on')
legend show
6 comentarios
Mathieu NOE
el 9 de Nov. de 2022
hello
why not simply do
plot(t+6, T1.(fn), 'DisplayName', fn);
Walter Roberson
el 19 de Nov. de 2022
plot(t+seconds(6), T1.(fn), 'DisplayName', fn);
+6 would be adding 6 days.
Steen
el 22 de Nov. de 2022
Mathieu NOE
el 22 de Nov. de 2022
IMHO, t is a numeric array so it should be t+6 and not t+seconds(6)
I am just repeating myself
Walter Roberson
el 22 de Nov. de 2022
Yes, that does appear to be numeric time in seconds.
Steen
el 23 de Nov. de 2022
Respuestas (0)
Categorías
Más información sobre Cell Arrays en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!