comparison util/SMALL_plot.m @ 8:33850553b702

(none)
author idamnjanovic
date Mon, 22 Mar 2010 10:56:54 +0000
parents 7750624e0c73
children fc395272d53e
comparison
equal deleted inserted replaced
7:0151f1ea080d 8:33850553b702
2 % Ivan Damnjanovic 2009 2 % Ivan Damnjanovic 2009
3 % Function gets as input SMALL structure and plots the solution and 3 % Function gets as input SMALL structure and plots the solution and
4 % reconstructed signal 4 % reconstructed signal
5 5
6 figure; 6 figure;
7 7
8 plot(1:length(SMALL.solver.solution), SMALL.solver.solution, 'b'); 8 m=size(SMALL.solver,2);
9 title(['Coefficients of the reconstructed signal using ', SMALL.solver.name, ' with parameters ', SMALL.solver.param]) 9 n=size(SMALL.solver(1).reconstructed,2)+1;
10 for i =1:m
11
12 subplot(m,n, (i-1)*n+1); plot(1:length(SMALL.solver(i).solution), SMALL.solver(i).solution, 'b')
13 title([ SMALL.solver(i).name,'(', SMALL.solver(i).param,')'])
10 xlabel('Coefficient') 14 xlabel('Coefficient')
11 15
12 % Use SMALL.solution to reconstruct the signal.
13
14 % Plot reconstructed signal against original 16 % Plot reconstructed signal against original
15 17
16 18
17 for i=1:size(SMALL.solver.reconstructed,2) 19 for j=2:n
18 figure; 20
19 plot(1:length(SMALL.solver.reconstructed(:,i)), SMALL.solver.reconstructed(:,i) ,'b.-', 1:length(SMALL.Problem.signal(:,i)), SMALL.Problem.signal(:,i),'r--'); 21 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--')
20 legend(SMALL.solver.name,'Original signal'); 22 %legend(SMALL.solver(i).name,'Original signal',0);
21 title('Reconstructed and original signals'); 23 title('Reconstructed and original signals');
22 end 24 end
23 end 25 end