自己レスになりますが、posixtimeを使ってできそうです。
datetime1 = datetime(2020,08,16,15,00,00,000);
datetime2 = datetime(2021,10,16,15,00,01,234);
ans = sprintf("%.3f", posixtime(datetime2) - posixtime(datetime1));
% 結果:ans = "36806401.234"
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!