# HG changeset patch # User Daniele Barchiesi # Date 1321528575 0 # Node ID dc2f0fa21310509b43a4a06873b844fa1915bbc3 # Parent 7426503fc4d1a823cc5a6b7e636e84a0faf71899 multiple trials with error bars diff -r 7426503fc4d1 -r dc2f0fa21310 examples/SMALL_test_coherence2.m --- 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--')