potential videowriter compat fix

This commit is contained in:
2025-11-10 13:29:44 -08:00
parent 8b14bfc5ce
commit 74088a13f3
7 changed files with 38 additions and 24 deletions

17
setupVideoWriter.m Normal file
View File

@@ -0,0 +1,17 @@
function v = setupVideoWriter(timestep)
arguments (Input)
timestep (1, 1) double;
end
arguments (Output)
v (1, 1) {mustBeA(v, 'VideoWriter')};
end
if ispc || ismac
v = VideoWriter(fullfile('sandbox', strcat(string(datetime('now'), 'yyyy_MM_dd_HH_mm_ss'), '_miSimHist')), 'MPEG-4');
elseif isunix
v = VideoWriter(fullfile('sandbox', strcat(string(datetime('now'), 'yyyy_MM_dd_HH_mm_ss'), '_miSimHist')), 'Motion JPEG AVI');
end
v.FrameRate = 1/timestep;
v.Quality = 90;
end