0001 function vb_plot_channel_trial(ratio1,ratio2, ...
0002 thred_val1,thred_val2,prob_val,thred_num)
0003
0004
0005
0006
0007
0008
0009
0010 [Nch, Ntry] = size(ratio1);
0011
0012
0013 if ~exist('thred_val1','var'), thred_val1 = [8:11]; end;
0014
0015 if ~exist('thred_val2','var'), thred_val2 = [8:11]; end;
0016
0017 if ~exist('prob_val','var'), prob_val = [0.02:0.01:0.05]; end;
0018 if ~exist('thred_num','var'), thred_num = ceil(Nch/4); end;
0019
0020 thred_std = 9;
0021
0022 Nthre = length(thred_val1);
0023 Nnum = length(prob_val);
0024
0025
0026 ratio1 = min(ratio1,max(thred_val1)+1);
0027 ratio2 = min(ratio2,max(thred_val2)+1);
0028
0029 NXfig=Nnum; NYfig=2;
0030 nfig = 1;
0031 figure;
0032
0033
0034 Mbad = zeros(Nthre,Nnum);
0035
0036 Mtry = zeros(Nthre,Nnum);
0037
0038 for n=1:Nthre
0039 for m=1:Nnum
0040 thred = [thred_val1(n), thred_val2(n)];
0041
0042 ch_act = [1:Nch];
0043 try_err = vb_find_bad_trial(ratio1,ratio2,ch_act,thred,thred_num);
0044 try_act = vb_setdiff2([1:Ntry],try_err);
0045
0046
0047 ix_ch = vb_find_bad_channel(ratio1(:,try_act),ratio2(:,try_act), ...
0048 thred,prob_val(m));
0049 ix_act = vb_setdiff2([1:Nch],ix_ch);
0050 ix_try = vb_find_bad_trial(ratio1,ratio2, ix_act, thred);
0051
0052 Mch(n,m) = length(ix_ch);
0053 Mtry(n,m) = length(ix_try);
0054 end
0055 end
0056
0057 for m=1:Nnum
0058 subplot(NYfig,NXfig,nfig); nfig = nfig + 1;
0059 plot(thred_val1(:),Mch(:,m))
0060 set(gca,'XTick',thred_val1(:))
0061 set(gca,'XTickLabel',[num2str(thred_val1(:)) repmat('/',Nthre,1) num2str(thred_val2(:))])
0062 hold on
0063 plot([thred_std thred_std], [0 max(Mch(:,m))],'--')
0064 xlim([thred_val1(1) thred_val1(end)])
0065 title(sprintf('Bad ch [p=%4.3f]',prob_val(m)))
0066 end
0067
0068 for m=1:Nnum
0069 subplot(NYfig,NXfig,nfig); nfig = nfig + 1;
0070 plot(thred_val1(:),Mtry(:,m))
0071 set(gca,'XTick',thred_val1(:))
0072 set(gca,'XTickLabel',[num2str(thred_val1(:)) repmat('/',Nthre,1) num2str(thred_val2(:))])
0073 hold on
0074 plot([thred_std thred_std], [0 max(Mtry(:,m))],'--')
0075 xlim([thred_val1(1) thred_val1(end)])
0076 title(sprintf('Bad Trial [p=%4.3f]',prob_val(m)))
0077 end