Get from Ico-github-logo

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
get_contents

  • functionTemplate(input_args)
    FUNCTIONTEMPLATE Summary of this function goes on this H1 line
  • iosr.acoustics.irStats(fi...
    IRSTATS Calculate RT, DRR, Cte, and EDT for impulse response file
  • iosr.acoustics.rtEst(abs_...
    RTEST Estimate reverberation time based on room size and absorption
  • iosr.auditory.azimuth2itd...
    AZIMUTH2ITD Convert azimuth in degrees to ITD
  • iosr.auditory.binSearch(S...
    Conduct a binary search
  • iosr.auditory.calcIld(L,R...
    CALCILD Calculate normalised interaural level difference
  • iosr.auditory.chXcorr(hc_...
    CHXCORR Calculate cross-correlograms with a wide range of options.
  • iosr.auditory.chXcorr2(hc...
    CHXCORR2 Calculate cross-correlograms with a range of options.
  • iosr.auditory.createWindo...
    Create a Hann or exp. window with specified onsets/offsets
  • iosr.auditory.dupWeight(f)
    DUP_WEIGHT Calculate duplex weighting coefficients for ITD and ILD
  • iosr.auditory.erbRate2hz(x)
    ERBRATE2HZ Convert ERB rate to Hz.
  • iosr.auditory.freqMulti(f)
    FREQMULTI Calculate frequency coefficient for ITD-azimuth warping
  • iosr.auditory.gammatoneFa...
    GAMMATONEFAST Produce an array of responses from gammatone filters via FFT
  • iosr.auditory.hz2erbRate(x)
    HZ2ERBRATE Convert Hz to ERB rate
  • iosr.auditory.instItd(l,r...
    INSTITD Calculate instantaneous ITD
  • iosr.auditory.iso226(phon...
    ISO226 ISO 226:2003 Normal equal-loudness-level contours
  • iosr.auditory.itd2azimuth...
    ITD2AZIMUTH Convert ITD to azimuth
  • iosr.auditory.lindemannIn...
    LINDEMANNINH Signal pre-processing for Lindemann's cross-correlation
  • iosr.auditory.loudWeight(...
    LOUDWEIGHT Calculate loudness weighting coefficients based on ISO 226
  • iosr.auditory.makeErbCFs(...
    MAKEERBCFS Make a series of center frequencies equally spaced in ERB-rate.
  • iosr.auditory.meddisHairC...
    Calculate Ray Meddis' hair cell model for a number of channels.
  • iosr.auditory.perceptualC...
    PERCEPTUALCENTROID Perceptual spectral centroid
  • iosr.auditory.xcorrLindem...
    XCORRLINDEMANN Cross-correlation based on Lindemann's precedence model
  • iosr.bss.applyIdealMasks(...
    APPLYIDEALMASKS Calculate and apply ideal masks via STFT
  • iosr.bss.applyMask(s,m,nf...
    APPLYMASK Apply a time-frequency mask to an STFT
  • iosr.bss.calcImr(m,im)
    CALCIMR Calculates the Ideal Mask Ratio (IMR)
  • iosr.bss.calcSnr(output,t...
    CALCSNR Calculate the separation SNR
  • iosr.bss.cfs2fcs(cfs,fs)
    CFS2FCS Calculate gammatone crossover frequencies.
  • iosr.bss.generateMixtures...
    GENERATEMIXTURES Generate arrays of mixtures from targets and interferers.
  • iosr.bss.getFullMask(m,fr...
    GETFULLMASK Convert frame rate mask to a sample-by-sample mask
  • iosr.bss.idealMasks(st,si...
    IDEALMASKS Calculate ideal time-frequency masks from STFTs
  • iosr.bss.resynthesise(x,f...
    RESYNTHESISE Resynthesise a target from a time-frequency mask
  • iosr.dsp.autocorr(x,Q,dim)
    AUTOCORR Perform autocorrelation via FFT
  • iosr.dsp.convFft(a,b,shape)
    CONVFFT Convolve two vectors using FFT multiplication
  • iosr.dsp.istft(s,nfft,hop...
    ISTFT Calculate the Inverse Short-Time Fourier Transform
  • iosr.dsp.lapwin(L,b)
    LAPWIN Laplace window.
  • iosr.dsp.localpeaks(x,mode)
    LOCALPEAKS Find local peaks and troughs in a vector
  • iosr.dsp.ltas(x,fs,varargin)
    LTAS calculate the long-term average spectrum of a signal
  • iosr.dsp.matchEQ(x,fs,mag...
    MATCHEQ Match the LTAS of a signal to an arbitrary spectral magnitude
  • iosr.dsp.rms(x,dim)
    RMS Calculate the rms of a vector or matrix
  • iosr.dsp.sincFilter(x,Wn,...
    SINCFILTER Apply a near-ideal low-pass or band-pass brickwall filter
  • iosr.dsp.smoothSpectrum(X...
    SMOOTHSPECTRUM Apply 1/N-octave smoothing to a frequency spectrum
  • iosr.dsp.stft(x,nfft,hop,fs)
    STFT Calculate the short-time Fourier transform of a signal
  • iosr.dsp.vsmooth(x,frame,...
    VSMOOTH Smooth a vector using mathematical functions
  • iosr.figures.chMap(M)
    CHMAP Create a monochrome-compatible colour map
  • iosr.figures.cmrMap(M)
    CMRMAP Create a monochrome-compatible colour map
  • iosr.figures.multiwaveplo...
    MULTIWAVEPLOT Stacked line plots from a matrix or vectors
  • iosr.figures.subfigrid(nr...
    SUBFIGRID Create axis positions for subfigures
  • iosr.general.cell2csv(C,f...
    CELL2CSV Output a cell array to a CSV file
  • iosr.general.checkMexComp...
    CHECKMEXCOMPILED Check if mex file is compiled for system
  • iosr.general.getContents(...
    GETCONTENTS Get the contents of a specified directory
  • iosr.general.updateConten...
    UPDATECONTENTS Create a Contents.m file including subdirectories
  • iosr.general.urn(varargin)
    URN Generate random number sequence without duplicates
  • iosr.install
    INSTALL Set search paths, and download and install dependencies.
  • iosr.statistics.getRmse(X...
    GETRMSE Calculate the root-mean-square error between input data
  • iosr.statistics.laprnd(va...
    LAPRND Pseudorandom numbers drawn from the Laplace distribution
  • iosr.statistics.qqPlot(va...
    QQPLOT Quantile-quantile plot with patch option
  • iosr.statistics.quantile(...
    QUANTILE Quantiles of a sample via various methods.
  • iosr.statistics.tab2box(X...
    TAB2BOX Prepare tabular data for boxPlot function
  • iosr.statistics.trirnd(va...
    TRIRND Pseudorandom numbers drawn from the triangular distribution
  • iosr.svn.buildSvnProfile(...
    BUILDSVNPROFILE Read data from files tagged with SVN keywords
  • iosr.svn.headRev(folders,...
    HEADREV Retrieve the head revision for specified files
  • iosr.svn.readSvnKeyword(f...
    READSVNKEYWORD Read data from a file tagged with an SVN keyword
  • classTemplate
    CLASSTEMPLATE Summary of this class goes on this H1 line
  • iosr.bss.mixture
    MIXTURE Class of binaural sound source separation mixture.
  • iosr.bss.source
    SOURCE Class of sound source separation source.
  • iosr.dsp.audio
    AUDIO Abstract superclass providing audio-related properties and methods.
  • iosr.statistics.boxPlot
    BOXPLOT Draw a box plot
  • Contents.m
    +IOSR
  • example.m
    determine STFT parameters
  • View all files

Join the 15-year community celebration.

Play games and win prizes!

» Learn more

Be the first to rate this file! 9 Downloads (last 30 days) File Size: 611 KB File ID: #30835 Version: 1.8

get_contents

by

 

23 Mar 2011 (Updated )

Get the contents of a specified directory

| Watch this File

File Information
Description

NOTE: this function is now available from the IoSR Matlab Toolbox as iosr.general.getContents.
-------------------------
cont = get_contents(directory)
cont = get_contents(directory,options)
[cont,dirflag] = get_contents(...)

This function returns the contents of a specified directory.

cont = get_contents(directory) returns the files and folders in directory and returns them to the cell array cont. It ignores hidden files and folders (those starting '.'). Directory must be a character array (string).

cont = get_contents(directory,options) allow search options to be specified. The options are specified in parameter/value pairs, and include:
    'rec' {false} | true
                Search recursively within the subfolders of the specified directory.
    'path' {'relative'} | 'full'
                Specifies whether returned paths are full or relative to the specified directory.
    'sort' {false} | true
                Specify whether the output is sorted alphabetically.
    'filter' {'all'} | 'files' | 'folders' | '*.ext' | str
                This option allows a filter to be specified. 'files' returns names of all files in the directory. 'folders' returns names of all folders in the directory. '*.ext', where 'ext' is a user-specified file extension, returns all files with the extension '.ext'. str may be any string; only elements that contain str will be returned (files or folders). str is case-sensitive.

[cont,dirflag] = get_contents(...) returns a logical array dirflag, the same size as cont, indicating whether each element is a directory.

Examples

    Ex. 1

    % Return all m-files in the current directory

    cont = get_contents(cd,'filter','*.m')

    Ex. 2

    % Return all files in the current directory and its
    % sub-directories

    cont = get_contents(cd,'rec',true)

    Ex. 3

    % Return all files in current directory with names
    % containing 'foo'
     
    % may return files and folders:
    [cont,dirflag] = get_contents(cd,'filter','foo')

    % use dirflag to limit:
    cont = cont(~dirflag);

MATLAB release MATLAB 7.11 (R2010b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Updates
28 Mar 2011 1.1

Updated help

10 Aug 2011 1.2

Added a keyword, allowing specific file extensions to be returned

11 Aug 2011 1.3

Some bug fixes. Additionally outputs a directory flag.

18 Jan 2012 1.4

Some bug fixes and additional inputs options permitted, including a recursive option. Input now in parameter/value pairs.

25 Apr 2013 1.6

Simplified interface such that str is not required (now varargin option). Also made sort and rec flags logical rather than strings.

03 Jun 2013 1.7

Minor update to help text and description.

03 Jun 2013 1.8

Minor update to file help text and description.

18 Sep 2016 1.8

Migrated to GitHub.

Contact us