clc;clear all;close all;number=45;strng=num2str(number);Folder = 'D:\project\Fingerspelling pics\';for k=1:length(strng) I(k)=str2num(strng(k)); aFile = fullfile(Folder, 'I(k).mp4'); videoFReader = vision.VideoFileReader(aFile); videoPlayer = vision.VideoPlayer; while ~isDone(videoFReader) frame = step(videoFReader); step(videoPlayer,frame); endend
My aim is to play the 4th and 5th video from the 'Folder' described in the code above. But when I am running the code it is producing error, since there is no any folder with the name I(k) in the 'Folder'. I want that as the value of I(k) changes in every iteration, correspondingly the video should be played from the folder. For example :- Here value of I(k) will be 4 and 5 of type 'double' in corresponding iterations and I have also my files 4.mp4 and 5.mp4 saved in 'Folder'. Please tell me how I can call and play the videos from 'Folder' using I(k) values.
Best Answer