annotate util/SMALL_plot.m @ 154:0de08f68256b ivand_dev

ALPS toolbox - Algebraic Pursuit added to smallbox
author Ivan Damnjanovic lnx <ivan.damnjanovic@eecs.qmul.ac.uk>
date Fri, 12 Aug 2011 11:17:47 +0100
parents b17f690df281
children
rev   line source
idamnjanovic@1 1 function SMALL_plot(SMALL)
ivan@128 2 %% Plots coefficients and reconstructed signals
ivan@128 3 % Function gets as input SMALL structure and plots the solution and
ivan@128 4 % reconstructed signal
ivan@128 5
idamnjanovic@24 6 %
idamnjanovic@24 7 % Centre for Digital Music, Queen Mary, University of London.
idamnjanovic@24 8 % This file copyright 2009 Ivan Damnjanovic.
idamnjanovic@24 9 %
idamnjanovic@24 10 % This program is free software; you can redistribute it and/or
idamnjanovic@24 11 % modify it under the terms of the GNU General Public License as
idamnjanovic@24 12 % published by the Free Software Foundation; either version 2 of the
idamnjanovic@24 13 % License, or (at your option) any later version. See the file
idamnjanovic@24 14 % COPYING included with this distribution for more information.
ivan@128 15 %%
idamnjanovic@1 16
idamnjanovic@1 17 figure;
idamnjanovic@8 18
idamnjanovic@8 19 m=size(SMALL.solver,2);
idamnjanovic@8 20 n=size(SMALL.solver(1).reconstructed,2)+1;
idamnjanovic@8 21 for i =1:m
idamnjanovic@8 22
idamnjanovic@8 23 subplot(m,n, (i-1)*n+1); plot(1:length(SMALL.solver(i).solution), SMALL.solver(i).solution, 'b')
ivan@154 24 title(sprintf('%s in %.2f s', SMALL.solver(i).name, SMALL.solver(i).time),'Interpreter','none')
idamnjanovic@1 25 xlabel('Coefficient')
idamnjanovic@1 26
idamnjanovic@1 27 % Plot reconstructed signal against original
idamnjanovic@1 28
idamnjanovic@1 29
idamnjanovic@8 30 for j=2:n
idamnjanovic@8 31
idamnjanovic@8 32 subplot(m,n,(i-1)*n+j); plot(1:length(SMALL.solver(i).reconstructed(:,j-1)), SMALL.solver(i).reconstructed(:,j-1) ,'b.-', 1:length(SMALL.Problem.signal(:,j-1)), SMALL.Problem.signal(:,j-1),'r--')
ivan@132 33 %legend(SMALL.solver(i).name,'Original signal',0,'Location','SouthOutside','Interpreter','none');
ivan@154 34 title(sprintf('%s in %.2f s signal %d', SMALL.solver(i).name, SMALL.solver(i).time,n-1),'Interpreter','none')
idamnjanovic@1 35 end
idamnjanovic@32 36 end
idamnjanovic@1 37 end