by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - Visualization
Introduced first in SolidGeometry 5.1, Creation date: 2021-12-06, Last change: 2025-08-19
drawnowvid([])
This function, drawnowvid, is designed to facilitate the creation of videos from animations in MATLAB. It is part of the SolidGeometry library and was developed by Tim Lueth. The function primarily serves as a replacement for the standard drawnow function, with added functionality for video creation.
varargin: This allows the function to accept a variable number of input arguments. The function uses getfuncparams to process these arguments, specifically extracting the first parameter.Videoquick_vw: A global variable that is expected to be a VideoWriter object. This variable is used to determine if video writing is active.varargin using getfuncparams.Videoquick_vw is a valid VideoWriter object.Videoquick_vw is valid, the function attempts to write frames to the video:n is not an integer, it is recalculated based on the frame rate of the video writer.n iterations, calling Videoquickwritegcf to write the current figure to the video.Videoquick_vw is set to an empty array, indicating that video writing is no longer active.Videoquick_vw is not valid, the function simply calls drawnow to update the screen without video output.The function includes a check for isSGfigureStop, which is not detailed in the provided code. This likely serves as a condition to halt execution for debugging purposes.
The function also contains commented-out lines for setting font size and pausing execution, which are not active in the current implementation.
Algorithm explaination created using ChatGPT on 2025-08-19 07:19. (Please note: No guarantee for the correctness of this explanation)