https://github.com/dianadima/mot_action
Raw File
Tip revision: af9eede56f27215ca38ddd32564017f1f90417d0 authored by Diana Dima on 20 November 2021, 02:04:32 UTC
final clean up fixes
Tip revision: af9eede
list_stimuli.m
function [videolist, categories, categories_idx] = list_stimuli(stimpath)
%UNTITLED6 Summary of this function goes here
%   Detailed explanation goes here

videolist = {};
categories = dir(stimpath); 
categories = {categories(3:end).name}; %remove first 2 which are not subdirectories
for c = 1:length(categories)
    categlist = dir(fullfile(stimpath,categories{c}));
    videolist = [videolist {categlist(3:end).name}]; %#ok<AGROW>
end
videolist = videolist';
videolist(contains(videolist, '.DS')) = []; %remove hidden .DSstore files

%get categories_idx variable
categories_idx = cell(1,length(categories));
for c = 1:length(categories_idx)
    categories_idx{c} = find(contains(videolist,categories{c}));   
end
end

back to top