0001 function funcs = showDiscriminantFuncs(cv,bwInvert)
0002
0003
0004
0005 if nargin < 2
0006 bwInvert = 0;
0007 end
0008
0009 reps = showTestRep(cv);
0010
0011 [nTasks,nTrials] = size(cv.classes);
0012 for ttrial = 1:nTrials
0013 w = cv.testResults{ttrial}{2}.weights;
0014 w = w - repmat(mean(w,2),1,nTasks);
0015 b = cv.testResults{ttrial}{2}.bias;
0016 funcs{ttrial} = reps{ttrial}' * w + ...
0017 repmat(b',size(reps{ttrial},2),1);
0018 if bwInvert
0019 f = funcs{ttrial};
0020 funcs{ttrial} = max(f(:)) - f;
0021 end
0022 end
0023
0024 clf;
0025 for ttrial = 1:nTrials
0026 subplot(nTrials,1,ttrial);
0027 imagesc(funcs{ttrial}');
0028 ylabel('Task Discriminant');
0029 n = size(funcs{ttrial},1);
0030 inc = n / nTasks;
0031 set(gca,'XTick',inc/2:inc:n);
0032 xlab = {};
0033 for i = 1:nTasks
0034 xlab = {xlab{:} ['Task ' num2str(i)]};
0035 end
0036 set(gca,'XTickLabel',xlab);
0037
0038 title(['Test Trial ' num2str(ttrial)]);
0039 end