MATLAB: How to convert a BAM file to SAM and GFF file to GTF for use in featurecount

Bioinformatics Toolbox

I would like to use the featurecount function in the Bioinformatics Toolbox. However it appears that it only accepts SAM and GTF files. My data is currently in a BAM and GFF files, which are nearly identical to SAM and GTF.
Is there any way to give these files to featurecount directly or to convert them using the Bioinformatics Toolbox? Doing this conversion directly through the Bioinformatics Toolbox would be convenient so that I don't have to manually do the work beforehand.

b = BioMap('test.bam');write(b,'test.sam','format','sam')
if exist('test.sam') ~= 2    !thirdpartyconversiontool test.bam test.samendif exist('test.gtf') ~= 2    !thirdpartyconversiontool test.gff test.gtfend