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