Now you can use OpenCV in MATLAB as well. The video shows how KNN based background subtractor from OpenCV can be used in MATLAB to subtract the background from videos. You can watch the demo in the video and access the code at github.com/sander-ali/Background_subtractor_opencv_MATLAB. Before running the code, make sure to install and import the OpenCV package in MATLAB.