function plotmst(mst,tg,m,nhd,lntp)
if nargin <3,m=1;end
if nargin <4,nhd=1;end
if nargin <5,lntp='-';end

global ubnd nf;

figure(m),
pn = 0;
    if pn == -1
       subplot(211), plot(tg, mst(1,:),lntp);
       if nhd ==1, hold on; end
       subplot(212), plot( tg,ubnd * exp(-exp(-mst(3,:)/10)),lntp);
       if nhd ==1, hold on; end
    elseif pn == 0
       subplot(311),
       for j = 1:nf
           plot(tg, mst(1+(j-1)*3,:),lntp);
           if nhd ==1, hold on; end
       end
       ylabel('amplitude')
       subplot(312), 
       for j = 1:nf
           plot( tg, mst(2+(j-1)*3,:),lntp);     
           if nhd ==1, hold on; end   
       end
       ylabel('phase')
       subplot(313), 
       for j = 1:nf
           plot( tg, mst(3+(j-1)*3,:),lntp);     
           if nhd ==1, hold on; end   
       end
       ylabel('frequency')       
    elseif pn == 1
       subplot(211),   plot(tg, sqrt(mst(1,:).^2 + mst(2,:).^2) ,lntp);
       if nhd ==1, hold on; end
       subplot(212), plot( tg,ubnd * exp(-exp(-mst(3,:)/10)),lntp);
       if nhd ==1, hold on; end
    elseif pn == 2
        subplot(211),plot(tg, mst(1,:))
        subplot(212), plot(tg, ubnd * exp(-exp(-mst(2,:)/10)));
    elseif pn == 3        
       subplot(211), plot(tg, sqrt(mst(1,:).^2 + mst(2,:).^2) ,lntp);
       if nhd ==1, hold on; end
       subplot(212), plot( tg,mst(3,:),lntp);
       if nhd ==1, hold on; end
        
    end
