How do I substract like variables from each other
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos

3 comentarios
Zahrah Walid
el 2 de Dic. de 2022
I guess this is somehow similar to your problem: https://www.mathworks.com/matlabcentral/answers/18717-time-difference-between-two-sets-of-times-in-hrs-mins-and-seconds-gui-if-possible
Respuestas (2)
Arif Hoq
el 2 de Dic. de 2022
one approach:
a=readmatrix("Book1.xlsx");
b= datetime(a,'ConvertFrom','excel');
% b(:,3)=b(:,2);
for i=1:size(b,1)-1
if b(i,1)==b(i+1,1)
c(i)=b(i+1,2)-b(i,2);
end
end
output=c'
0 comentarios
Voss
el 3 de Dic. de 2022
a = readmatrix("Book1.xlsx");
b = datetime(a(:,2),'ConvertFrom','excel');
N = size(a,1);
c = duration(NaN(N,3));
for i = 1:N-1
if a(i,1) == a(i+1,1)
c(i+1) = b(i+1)-b(i);
end
end
disp(c);
0 comentarios
Ver también
Categorías
Más información sobre Develop Apps Using App Designer en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!