I made a function file in MATLAB 6.5 - compound.m as
function [captial,interest] = compound(capital,years,rate,timescomp);
% COMPOUND: function to compute the compounded capital and the interest
% call syntax:
% [capital,interest] = compound(capital,years,rate,timescomp);
%...