function img=grabimage(shutter_time, Naverages) % This funcion calls the external program which takes an image from camera % with apropriate settings. cmnd_string = horzcat('grabNimages_1394cam.exe', ' -s ',num2str(shutter_time),' -n ',num2str(Naverages)); [status,result] = system(cmnd_string); % by default our grabber save png image to this file name image_name = 'test.png'; img=imread(image_name);