Mercurial > hg > smallbox
changeset 174:dc2f0fa21310 danieleb
multiple trials with error bars
author | Daniele Barchiesi <daniele.barchiesi@eecs.qmul.ac.uk> |
---|---|
date | Thu, 17 Nov 2011 11:16:15 +0000 |
parents | 7426503fc4d1 |
children | 9eb5f0d4c1a4 |
files | examples/SMALL_test_coherence2.m |
diffstat | 1 files changed, 7 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/examples/SMALL_test_coherence2.m Thu Nov 17 11:15:02 2011 +0000 +++ b/examples/SMALL_test_coherence2.m Thu Nov 17 11:16:15 2011 +0000 @@ -71,7 +71,7 @@ %% Evaluate coherence and snr of representation for the various methods sr = zeros(size(SMALL.DL)); %signal to noise ratio -mu = zeros(iTrial,iInitDicts,iCorrLevels,iDecorrAlgs,blockSize); %cumulative coherence +mu = zeros(nTrials,nInitDicts,nCorrLevels,nDecorrAlgs,blockSize); %cumulative coherence dic(size(SMALL.DL)) = dictionary; %initialise dictionary objects for iTrial=1:nTrials for iInitDicts=1:nInitDicts @@ -96,15 +96,17 @@ %% Plot results minMu = sqrt((dictSize-blockSize)/(blockSize*(dictSize-1))); %lowe bound on coherence initDictsNames = {'Data','Gabor'}; -dicDecorrNames = {'Iter. Proj. + Rotation','INK-SVD','Iter. Proj.'}; -lineStyles = {'ks-','kd-','ko-'}; +dicDecorrNames = {'IPR','INK-SVD','IP'}; +lineStyles = {'k.-','r*-','b+-'}; for iInitDict=1:nInitDicts figure, hold on, grid on title([initDictsNames{iInitDict} ' Initialisation']); plot([1 1],[0 25],'k-'); for iDecorrAlgs=1:nDecorrAlgs - plot(mu(1,iInitDict,:,iDecorrAlgs,1),sr(1,iInitDict,:,iDecorrAlgs),... - lineStyles{iDecorrAlgs}); + coherenceLevels = squeeze(mean(mu(:,iInitDict,:,iDecorrAlgs,1),1)); + meanSNRs = squeeze(mean(sr(:,iInitDict,:,iDecorrAlgs),1)); + stdSNRs = squeeze(std(sr(:,iInitDict,:,iDecorrAlgs),0,1)); + errorbar(coherenceLevels,meanSNRs,stdSNRs,lineStyles{iDecorrAlgs}); end plot([minMu minMu],[0 25],'k--')