diff -c -r spike/demo/demo_binless.m spike.oct/demo/demo_binless.m
*** spike/demo/demo_binless.m	2006-12-01 13:42:16.000000000 -0500
--- spike.oct/demo/demo_binless.m	2007-03-12 15:41:04.000000000 -0400
***************
*** 44,50 ****
  clear temp_info_shuf temp_info_jk;
  
  figure;
! set(gcf,'name',['Binless ' dataset ' demo']); 
  
  subplot(221);
  staraster(X,[opts.start_time opts.end_time]);
--- 44,51 ----
  clear temp_info_shuf temp_info_jk;
  
  figure;
! warning("octave!=matlab :: figure name omitted b/c gcf has no member 'name'");
! %set(gcf,'name',['Binless ' dataset ' demo']); 
  
  subplot(221);
  staraster(X,[opts.start_time opts.end_time]);
***************
*** 75,88 ****
    subplot(222);
    title('Embedded spike trains');
    hold on;
!   colororder = get(gca,'colororder');
    num_colors = size(colororder,1);
    for m=1:X.M
      cur_color = colororder(mod(m-1,num_colors)+1,:);
      in_idx = find(out(D_max_idx).categories==m-1);
      h=plot3(out(D_max_idx).embedded(in_idx,2), ...
              out(D_max_idx).embedded(in_idx,3), ...
!             out(D_max_idx).embedded(in_idx,4),'.');
      set(h,'color',cur_color);
      xlabel('Dimension 1');
      ylabel('Dimension 2');
--- 76,91 ----
    subplot(222);
    title('Embedded spike trains');
    hold on;
! 	warning("octave!=matlab :: colors set manually b/c gca has no member 'colororder'");
!   %colororder = get(gca,'colororder');
!   colororder = [0 0 0;0 0 1;1 0 0;0 1 0;1 0 1;1 1 0;0 1 1;.5 .5 .5];
    num_colors = size(colororder,1);
    for m=1:X.M
      cur_color = colororder(mod(m-1,num_colors)+1,:);
      in_idx = find(out(D_max_idx).categories==m-1);
      h=plot3(out(D_max_idx).embedded(in_idx,2), ...
              out(D_max_idx).embedded(in_idx,3), ...
!             out(D_max_idx).embedded(in_idx,4),'o');
      set(h,'color',cur_color);
      xlabel('Dimension 1');
      ylabel('Dimension 2');
***************
*** 116,127 ****
  opts.entropy_estimation_method = {'plugin'};
  rand('state',0);
  S=10;
  for D_max_idx=1:length(D_max_vec)
    opts.max_embed_dim = D_max_vec(D_max_idx);
!   [out_unshuf(D_max_idx),shuf(:,D_max_idx),opts_used] = binless_shuf(X,opts,S);
    info_unshuf(D_max_idx) = out_unshuf(D_max_idx).I_total.value;
    for s=1:S
!     temp_info_shuf(s,D_max_idx) = shuf(s,D_max_idx).I_total.value;
    end
  end
  info_shuf = mean(temp_info_shuf,1);
--- 119,137 ----
  opts.entropy_estimation_method = {'plugin'};
  rand('state',0);
  S=10;
+ warning("octave!=matlab :: transpose required b/c 2nd output of binless_shuf is transposed");
  for D_max_idx=1:length(D_max_vec)
    opts.max_embed_dim = D_max_vec(D_max_idx);
! 	% OCTAVE %
!   [out_unshuf(D_max_idx),shuf(D_max_idx,:),opts_used] = binless_shuf(X,opts,S);
! 	% MATLAB
! 	% [out_unshuf(D_max_idx),shuf(:,D_max_idx),opts_used] = binless_shuf(X,opts,S);
    info_unshuf(D_max_idx) = out_unshuf(D_max_idx).I_total.value;
    for s=1:S
! 		% OCTAVE %
!     temp_info_shuf(s,D_max_idx) = shuf(D_max_idx,s).I_total.value;
! 		% MATLAB
!     % temp_info_shuf(s,D_max_idx) = shuf(s,D_max_idx).I_total.value;
    end
  end
  info_shuf = mean(temp_info_shuf,1);
***************
*** 129,141 ****
  
  %%% Leave-one-out jackknife
  
  for D_max_idx=1:length(D_max_vec)
    opts.max_embed_dim = D_max_vec(D_max_idx);
!   [out_unjk(D_max_idx),jk(:,D_max_idx),opts_used] = binless_jack(X,opts);
    info_unjk(D_max_idx)= out_unjk(D_max_idx).I_total.value;
    P_total = length(jk);
    for p=1:P_total
!     temp_info_jk(p,D_max_idx) = jk(p,D_max_idx).I_total.value;
    end
  end
  info_jk_sem = sqrt((P_total-1)*var(temp_info_jk,1,1));
--- 139,158 ----
  
  %%% Leave-one-out jackknife
  
+ warning("octave!=matlab :: transpose required b/c 2nd output of binless_jack is transposed");
  for D_max_idx=1:length(D_max_vec)
    opts.max_embed_dim = D_max_vec(D_max_idx);
! 	% OCTAVE %
!   [out_unjk(D_max_idx),jk(D_max_idx,:),opts_used] = binless_jack(X,opts);
! 	% MATLAB
! 	% [out_unjk(D_max_idx),jk(:,D_max_idx),opts_used] = binless_jack(X,opts);
    info_unjk(D_max_idx)= out_unjk(D_max_idx).I_total.value;
    P_total = length(jk);
    for p=1:P_total
! 		% OCTAVE %
!     temp_info_jk(p,D_max_idx) = jk(D_max_idx,p).I_total.value;
! 		% MATLAB
!     % temp_info_jk(p,D_max_idx) = jk(p,D_max_idx).I_total.value;
    end
  end
  info_jk_sem = sqrt((P_total-1)*var(temp_info_jk,1,1));
***************
*** 143,151 ****
  %%% Plot results
  
  subplot(224);
! errorbar(D_max_vec,info_unjk,2*info_jk_sem);
  hold on;
! errorbar(D_max_vec,info_shuf,2*info_shuf_std,'r');
  hold off;
  set(gca,'xtick',D_max_vec);
  set(gca,'xlim',[min(D_max_vec) max(D_max_vec)]);
--- 160,171 ----
  %%% Plot results
  
  subplot(224);
! warning("octave!=matlab :: subplot(224) -> using 'plot' b/c 'errorbar' seems broken");
! plot(D_max_vec, info_unjk, 'b', D_max_vec, info_unjk+2*info_jk_sem, 'm', D_max_vec, info_unjk-2*info_jk_sem, 'm');
! %errorbar(D_max_vec,info_unjk,2*info_jk_sem);
  hold on;
! plot(D_max_vec, info_shuf, 'b', D_max_vec, info_shuf+2*info_shuf_std, 'm', D_max_vec, info_shuf-2*info_shuf_std, 'm');
! %errorbar(D_max_vec,info_shuf,2*info_shuf_std,'r');
  hold off;
  set(gca,'xtick',D_max_vec);
  set(gca,'xlim',[min(D_max_vec) max(D_max_vec)]);
***************
*** 155,158 ****
  legend('Original data (\pm 2 SE via Jackknife)','Shuffled data (\pm 2 SD)',...
         'location','best');
  
! scalefig(gcf,1.5);
--- 175,179 ----
  legend('Original data (\pm 2 SE via Jackknife)','Shuffled data (\pm 2 SD)',...
         'location','best');
  
! warning("octave!=matlab :: scalefig not used b/c gcf has no member 'position'");
! %scalefig(gcf,1.5);
diff -c -r spike/demo/demo_directcat.m spike.oct/demo/demo_directcat.m
*** spike/demo/demo_directcat.m	2006-12-01 13:42:16.000000000 -0500
--- spike.oct/demo/demo_directcat.m	2007-03-12 15:41:04.000000000 -0400
***************
*** 41,47 ****
  clear temp_info_shuf temp_info_jk;
  
  figure;
! set(gcf,'name',['Direct ' dataset ' demo']); 
  
  subplot(221);
  staraster(X,[opts.start_time opts.end_time]);
--- 41,48 ----
  clear temp_info_shuf temp_info_jk;
  
  figure;
! warning("octave!=matlab :: figure name omitted b/c gcf has no member 'name'");
! %set(gcf,'name',['Direct ' dataset ' demo']); 
  
  subplot(221);
  staraster(X,[opts.start_time opts.end_time]);
***************
*** 64,69 ****
--- 65,71 ----
  plot(1:length(Delta_frac),info_tpmc,'--');
  plot(1:length(Delta_frac),info_jack,'-.');
  hold off;
+ warning("octave!=matlab :: subplot(223) -> xticks and xticklabels seem broken");
  set(gca,'xtick',1:length(Delta_frac));
  set(gca,'xticklabel',Delta_frac);
  set(gca,'xdir','rev');
***************
*** 78,89 ****
  opts.entropy_estimation_method = {'plugin'};
  rand('state',0);
  S=10;
  for Delta_idx=1:length(Delta_vec)
    opts.counting_bin_size = Delta_vec(Delta_idx);
!   [out_unshuf(Delta_idx),shuf(:,Delta_idx),opts_used] = directcat_shuf(X,opts,S);
    info_unshuf(Delta_idx) = out_unshuf(Delta_idx).cond.information.value;
    for s=1:S
!     temp_info_shuf(s,Delta_idx) = shuf(s,Delta_idx).cond.information.value;
    end
  end
  info_shuf = mean(temp_info_shuf,1);
--- 80,98 ----
  opts.entropy_estimation_method = {'plugin'};
  rand('state',0);
  S=10;
+ warning("octave!=matlab :: transpose required b/c 2nd output of directcat_shuf is transposed");
  for Delta_idx=1:length(Delta_vec)
    opts.counting_bin_size = Delta_vec(Delta_idx);
! 	% OCTAVE %
!   [out_unshuf(Delta_idx),shuf(Delta_idx,:),opts_used] = directcat_shuf(X,opts,S);
! 	% MATLAB
!   % [out_unshuf(Delta_idx),shuf(:,Delta_idx),opts_used] = directcat_shuf(X,opts,S);
    info_unshuf(Delta_idx) = out_unshuf(Delta_idx).cond.information.value;
    for s=1:S
!   	% OCTAVE %
!     temp_info_shuf(s,Delta_idx) = shuf(Delta_idx,s).cond.information.value;
! 		% MATLAB
!     % temp_info_shuf(s,Delta_idx) = shuf(s,Delta_idx).cond.information.value;
    end
  end
  info_shuf = mean(temp_info_shuf,1);
***************
*** 91,112 ****
  
  %%% Leave-one-out jackknife
  
  for Delta_idx=1:length(Delta_vec)
    opts.counting_bin_size = Delta_vec(Delta_idx);
!   [out_unjk(Delta_idx),jk(:,Delta_idx),opts_used] = directcat_jack(X,opts);
    info_unjk(Delta_idx)= out_unjk(Delta_idx).cond.information.value;
    P_total = length(jk);
    for p=1:P_total
!     temp_info_jk(p,Delta_idx) = jk(p,Delta_idx).cond.information.value;
    end
  end
  info_jk_sem = sqrt((P_total-1)*var(temp_info_jk,1,1));
  
  subplot(224);
! errorbar(1:length(Delta_frac),info_unjk,2*info_jk_sem);
  hold on;
! errorbar(1:length(Delta_frac),info_shuf,2*info_shuf_std,'r');
  hold off;
  set(gca,'xtick',1:length(Delta_frac));
  set(gca,'xticklabel',Delta_frac);
  set(gca,'xdir','rev');
--- 100,133 ----
  
  %%% Leave-one-out jackknife
  
+ warning("octave!=matlab :: transpose required b/c 2nd output of directcat_jack is transposed");
  for Delta_idx=1:length(Delta_vec)
    opts.counting_bin_size = Delta_vec(Delta_idx);
! 	% OCTAVE %
!   [out_unjk(Delta_idx),jk(Delta_idx,:),opts_used] = directcat_jack(X,opts);
!   % MATLAB
!   % [out_unjk(Delta_idx),jk(:,Delta_idx),opts_used] = directcat_jack(X,opts);
    info_unjk(Delta_idx)= out_unjk(Delta_idx).cond.information.value;
    P_total = length(jk);
    for p=1:P_total
! 		% OCTAVE %
!     temp_info_jk(p,Delta_idx) = jk(Delta_idx,p).cond.information.value;
! 	  % MATLAB
!     % temp_info_jk(p,Delta_idx) = jk(p,Delta_idx).cond.information.value;
    end
  end
  info_jk_sem = sqrt((P_total-1)*var(temp_info_jk,1,1));
  
  subplot(224);
! warning("octave!=matlab :: subplot(224) -> using 'plot' b/c 'errorbar' seems broken");
! xinds = 1:length(Delta_frac);
! plot(xinds, info_unjk, 'b', xinds, info_unjk+2*info_jk_sem, 'm', xinds, info_unjk-2*info_jk_sem, 'm');
! %errorbar(1:length(Delta_frac),info_unjk,2*info_jk_sem);
  hold on;
! plot(xinds, info_shuf, 'b', xinds, info_shuf+2*info_shuf_std, 'm', xinds, info_shuf-2*info_shuf_std, 'm');
! %errorbar(1:length(Delta_frac),info_shuf,2*info_shuf_std,'r');
  hold off;
+ warning("octave!=matlab :: subplot(224) -> xticks and xticklabels seem broken");
  set(gca,'xtick',1:length(Delta_frac));
  set(gca,'xticklabel',Delta_frac);
  set(gca,'xdir','rev');
***************
*** 116,119 ****
  ylabel('Information (bits)');
  legend('Original data (\pm 2 SE via Jackknife)','Shuffled data (\pm 2 SD)',4);
  
! scalefig(gcf,1.5);
--- 137,141 ----
  ylabel('Information (bits)');
  legend('Original data (\pm 2 SE via Jackknife)','Shuffled data (\pm 2 SD)',4);
  
! warning("octave!=matlab :: scalefig not used b/c gcf has no member 'position'");
! %scalefig(gcf,1.5);
diff -c -r spike/demo/demo_directformal.m spike.oct/demo/demo_directformal.m
*** spike/demo/demo_directformal.m	2006-12-01 13:42:16.000000000 -0500
--- spike.oct/demo/demo_directformal.m	2007-03-12 15:41:04.000000000 -0400
***************
*** 95,108 ****
  info_rate_bub = info_bub./(L_vec*Delta);
  
  figure;
! set(gcf,'name','Formal information demo'); 
  
  subplot(221);
! plot(1./L_vec,H_total_rate_plugin,'marker','.');
  hold on;
! plot(1./L_vec,H_total_rate_tpmc,'r','marker','.');
! plot(1./L_vec,H_total_rate_jack,'g','marker','.');
! plot(1./L_vec(bub_idx),H_total_rate_bub(bub_idx),'c','marker','.');
  hold off;
  legend('Plug-in','TPMC','Jackknife','BUB', ...
         'location','best');
--- 95,111 ----
  info_rate_bub = info_bub./(L_vec*Delta);
  
  figure;
! warning("octave!=matlab :: figure name omitted b/c gcf has no member 'name'");
! %set(gcf,'name','Formal information demo'); 
  
  subplot(221);
! plot(1./L_vec,[H_total_rate_plugin;H_total_rate_tpmc; H_total_rate_jack],'-o');
! %plot(1./L_vec,H_total_rate_plugin,'marker','.');
  hold on;
! %plot(1./L_vec,H_total_rate_tpmc,'r','marker','.');
! %plot(1./L_vec,H_total_rate_jack,'g','marker','.');
! plot(1./L_vec(bub_idx),H_total_rate_bub(bub_idx),'-o');
! %plot(1./L_vec(bub_idx),H_total_rate_bub(bub_idx),'c','marker','.');
  hold off;
  legend('Plug-in','TPMC','Jackknife','BUB', ...
         'location','best');
***************
*** 111,121 ****
  title('Total entropy rate');
  
  subplot(222);
! plot(1./L_vec,H_noise_rate_plugin,'marker','.');
  hold on;
! plot(1./L_vec,H_noise_rate_tpmc,'r','marker','.');
! plot(1./L_vec,H_noise_rate_jack,'g','marker','.');
! plot(1./L_vec(bub_idx),H_noise_rate_bub(bub_idx),'c','marker','.');
  hold off;
  legend('Plug-in','TPMC','Jackknife','BUB', ...
         'location','best');
--- 114,126 ----
  title('Total entropy rate');
  
  subplot(222);
! plot(1./L_vec,[H_noise_rate_plugin;H_noise_rate_tpmc; H_noise_rate_jack],'-o');
! %plot(1./L_vec,H_noise_rate_plugin,'marker','.');
  hold on;
! %plot(1./L_vec,H_noise_rate_tpmc,'r','marker','.');
! %plot(1./L_vec,H_noise_rate_jack,'g','marker','.');
! plot(1./L_vec(bub_idx),H_noise_rate_bub(bub_idx),'-o');
! %plot(1./L_vec(bub_idx),H_noise_rate_bub(bub_idx),'c','marker','.');
  hold off;
  legend('Plug-in','TPMC','Jackknife','BUB', ...
         'location','best');
***************
*** 124,134 ****
  title('Noise entropy rate');
  
  subplot(223);
! plot(1./L_vec,H_total_rate_plugin,'marker','.');
  hold on;
! plot(1./L_vec,H_total_rate_ma,'r','marker','.');
! plot(1./L_vec,H_noise_rate_plugin,'--','marker','.');
! plot(1./L_vec,H_noise_rate_ma,'r--','marker','.');
  hold off;
  legend('Total (plug-in)','Total (Ma bound)',...
         'Noise (plug-in)','Noise (Ma bound)',...
--- 129,141 ----
  title('Noise entropy rate');
  
  subplot(223);
! plot(1./L_vec,[H_total_rate_plugin;H_total_rate_ma],'-o');
! %plot(1./L_vec,H_total_rate_plugin,'marker','.');
  hold on;
! %plot(1./L_vec,H_total_rate_ma,'r','marker','.');
! plot(1./L_vec,[H_noise_rate_plugin;H_noise_rate_ma],'--x');
! %plot(1./L_vec,H_noise_rate_plugin,'--','marker','.');
! %plot(1./L_vec,H_noise_rate_ma,'r--','marker','.');
  hold off;
  legend('Total (plug-in)','Total (Ma bound)',...
         'Noise (plug-in)','Noise (Ma bound)',...
***************
*** 145,155 ****
  info_true = lambda*((H_diff_total-H_diff_noise)/log(2));
  
  subplot(224);
! plot(1./L_vec,info_rate_plugin,'marker','.');
  hold on;
! plot(1./L_vec,info_rate_tpmc,'r','marker','.');
! plot(1./L_vec,info_rate_jack,'g','marker','.');
! plot(1./L_vec(bub_idx),info_rate_bub(bub_idx),'c','marker','.');
  plot([0 1./L_vec(1)],[info_true info_true],'k--');
  hold off;
  axis([0 0.5 0 200]);
--- 152,164 ----
  info_true = lambda*((H_diff_total-H_diff_noise)/log(2));
  
  subplot(224);
! plot(1./L_vec,[info_rate_plugin;info_rate_tpmc;info_rate_jack],'o-');
! %plot(1./L_vec,info_rate_plugin,'marker','.');
  hold on;
! %plot(1./L_vec,info_rate_tpmc,'r','marker','.');
! %plot(1./L_vec,info_rate_jack,'g','marker','.');
! plot(1./L_vec(bub_idx),info_rate_bub(bub_idx),'o-');
! %plot(1./L_vec(bub_idx),info_rate_bub(bub_idx),'c','marker','.');
  plot([0 1./L_vec(1)],[info_true info_true],'k--');
  hold off;
  axis([0 0.5 0 200]);
***************
*** 159,163 ****
  ylabel('Information rate (bits/sec)');
  title('Information rate');
  
! scalefig(gcf,2);
  
--- 168,173 ----
  ylabel('Information rate (bits/sec)');
  title('Information rate');
  
! warning("octave!=matlab :: scalefig not used b/c gcf has no member 'position'");
! %scalefig(gcf,2);
  
diff -c -r spike/demo/demo_entropy.m spike.oct/demo/demo_entropy.m
*** spike/demo/demo_entropy.m	2006-12-01 13:42:16.000000000 -0500
--- spike.oct/demo/demo_entropy.m	2007-03-12 15:56:16.000000000 -0400
***************
*** 80,86 ****
  end
  
  figure;
! set(gcf,'name','Entropy method demo'); 
  
  subplot(231);
  semilogx(N_vec,mean_entropy');
--- 80,87 ----
  end
  
  figure;
! warning("octave!=matlab :: figure name omitted b/c gcf has no member 'name'");
! %set(gcf,'name','Entropy method demo'); 
  
  subplot(231);
  semilogx(N_vec,mean_entropy');
***************
*** 101,106 ****
--- 102,109 ----
  
  % Standard error via jackknife
  subplot(232);
+ warning("octave!=matlab :: removing final row of rms_stderr_jack b/c ???");
+ rms_stderr_jack(6,:) = [];
  loglog(N_vec,rms_stderr_jack');
  xlabel('Total words observed');
  ylabel('Standard error (bits)');
***************
*** 119,124 ****
--- 122,129 ----
  
  % Standard error via bootstrap
  subplot(233);
+ warning("octave!=matlab :: removing final row of rms_stderr_boot b/c ???");
+ rms_stderr_boot(6,:) = [];
  loglog(N_vec,rms_stderr_boot');
  xlabel('Total words observed');
  ylabel('Standard error (bits)');
***************
*** 135,138 ****
  ylabel('Fraction of estimates w/in 95% CL');
  title('CL validation via bootstrap');
  
! scalefig(gcf,2);
\ No newline at end of file
--- 140,144 ----
  ylabel('Fraction of estimates w/in 95% CL');
  title('CL validation via bootstrap');
  
! warning("octave!=matlab :: scalefig not used b/c gcf has no member 'position'");
! %scalefig(gcf,2);
diff -c -r spike/demo/demo_metric.m spike.oct/demo/demo_metric.m
*** spike/demo/demo_metric.m	2006-12-01 13:42:16.000000000 -0500
--- spike.oct/demo/demo_metric.m	2007-03-12 15:41:04.000000000 -0400
***************
*** 42,48 ****
  clear temp_info_shuf temp_info_jk;
  
  figure;
! set(gcf,'name',['Metric ' dataset ' demo']); 
  
  subplot(221);
  staraster(X,[opts.start_time opts.end_time]);
--- 42,49 ----
  clear temp_info_shuf temp_info_jk;
  
  figure;
! warning("octave!=matlab :: figure name omitted b/c gcf has no member 'name'");
! %set(gcf,'name',['Metric ' dataset ' demo']); 
  
  subplot(221);
  staraster(X,[opts.start_time opts.end_time]);
***************
*** 61,67 ****
  
  subplot(222);
  [max_info,max_info_idx]=max(info_plugin);
! imagesc(out(max_info_idx).d);
  xlabel('Spike train index');
  ylabel('Spike train index');
  title('Distance matrix at maximum information');
--- 62,71 ----
  
  subplot(222);
  [max_info,max_info_idx]=max(info_plugin);
! warning("octave!=matlab :: subplot(222) -> using 'mesh' b/c 'imagesc' seems broken");
! mesh(out(max_info_idx).d);
! set(gca,'view',[0,-90]);
! %imagesc(out(max_info_idx).d);
  xlabel('Spike train index');
  ylabel('Spike train index');
  title('Distance matrix at maximum information');
***************
*** 72,77 ****
--- 76,82 ----
  plot(1:length(opts.shift_cost),info_tpmc,'--');
  plot(1:length(opts.shift_cost),info_jack,'-.');
  hold off;
+ warning("octave!=matlab :: subplot(223) -> xticks and xticklabels seem broken");
  set(gca,'xtick',1:length(opts.shift_cost));
  set(gca,'xticklabel',opts.shift_cost);
  set(gca,'xlim',[1 length(opts.shift_cost)]);
***************
*** 113,122 ****
  %%% Plot results
  
  subplot(224);
! errorbar(1:length(opts.shift_cost),info_unjk,2*info_jk_sem);
  hold on;
! errorbar(1:length(opts.shift_cost),info_shuf,2*info_shuf_std,'r');
  hold off;
  set(gca,'xtick',1:length(opts.shift_cost));
  set(gca,'xticklabel',opts.shift_cost);
  set(gca,'xlim',[1 length(opts.shift_cost)]);
--- 118,132 ----
  %%% Plot results
  
  subplot(224);
! warning("octave!=matlab :: subplot(224) -> using 'plot' b/c 'errorbar' seems broken");
! xinds = 1:length(opts.shift_cost);
! plot(xinds, info_unjk, 'b', xinds, info_unjk+2*info_jk_sem, 'm', xinds, info_unjk-2*info_jk_sem, 'm');
! %errorbar(1:length(opts.shift_cost),info_unjk,2*info_jk_sem);
  hold on;
! plot(xinds, info_shuf, 'b', xinds, info_shuf+2*info_shuf_std, 'm', xinds, info_shuf-2*info_shuf_std, 'm');
! %errorbar(1:length(opts.shift_cost),info_shuf,2*info_shuf_std,'r');
  hold off;
+ warning("octave!=matlab :: subplot(224) -> xticks and xticklabels seem broken");
  set(gca,'xtick',1:length(opts.shift_cost));
  set(gca,'xticklabel',opts.shift_cost);
  set(gca,'xlim',[1 length(opts.shift_cost)]);
***************
*** 126,129 ****
  legend('Original data (\pm 2 SE via Jackknife)','Shuffled data (\pm 2 SD)',...
         'location','best');
  
! scalefig(gcf,1.5);
--- 136,140 ----
  legend('Original data (\pm 2 SE via Jackknife)','Shuffled data (\pm 2 SD)',...
         'location','best');
  
! warning("octave!=matlab :: scalefig not used b/c gcf has no member 'position'");
! %scalefig(gcf,1.5);
diff -c -r spike/info/binless/binlessinfo.c spike.oct/info/binless/binlessinfo.c
*** spike/info/binless/binlessinfo.c	2006-12-01 13:42:16.000000000 -0500
--- spike.oct/info/binless/binlessinfo.c	2007-03-12 15:41:04.000000000 -0400
***************
*** 124,130 ****
  
    if(mxIsClass(prhs[3],"int32")==0)
      mexWarnMsgIdAndTxt("STAToolkit:binlessinfo:wrongType","M is not int32.");
!   S = mxGetScalar(prhs[3]);
  
    I_part = (struct estimate *)mxMalloc((*opts_ent).E*sizeof(struct estimate));
    plhs[0] = AllocEst(I_part,opts_ent);
--- 124,130 ----
  
    if(mxIsClass(prhs[3],"int32")==0)
      mexWarnMsgIdAndTxt("STAToolkit:binlessinfo:wrongType","M is not int32.");
!   S = (int)mxGetScalar(prhs[3]);
  
    I_part = (struct estimate *)mxMalloc((*opts_ent).E*sizeof(struct estimate));
    plhs[0] = AllocEst(I_part,opts_ent);
diff -c -r spike/shared/gen_mx.c spike.oct/shared/gen_mx.c
*** spike/shared/gen_mx.c	2006-12-01 13:42:16.000000000 -0500
--- spike.oct/shared/gen_mx.c	2007-03-12 15:41:04.000000000 -0400
***************
*** 41,50 ****
    int m;
  
    out = (double **)mxCalloc(M,sizeof(double *));
!   out[0] = (double *)mxCalloc(M*N,sizeof(double));
!   for(m=1;m<M;m++)
!     out[m] = out[m-1]+N;
! 
    return out;
  }
  
--- 41,55 ----
    int m;
  
    out = (double **)mxCalloc(M,sizeof(double *));
!   // if MATLAB
!   // out[0] = (double *)mxCalloc(M*N,sizeof(double));
!   // for(m=1;m<M;m++)
!     // out[m] = out[m-1]+N;
! 	// else OCTAVE
! 	for (m=0;m<M;m++)
! 		out[m] = (double *)mxCalloc(N,sizeof(double));
! 	// endif
! 	
    return out;
  }
  
***************
*** 241,247 ****
  
  void mxAddAndSetField(mxArray *in,int n,const char *field_name,mxArray *value)
  {
!   mxAddField(in,field_name);
    mxSetField(in,n,field_name,value);
  }
  
--- 246,258 ----
  
  void mxAddAndSetField(mxArray *in,int n,const char *field_name,mxArray *value)
  {
! 	// if MATLAB
!   // mxAddField(in,field_name);
!   // else OCTAVE
!   if (mxGetField(in,0,field_name)==NULL)
! 		mxAddField(in,field_name);
! 	// endif
! 	
    mxSetField(in,n,field_name,value);
  }
  
***************
*** 262,268 ****
    int flag;
    
    tmp = mxGetField(in,0,field_name);
!   if(tmp==NULL)
      flag = 0;
    else
      {
--- 273,283 ----
    int flag;
    
    tmp = mxGetField(in,0,field_name);
! 	// if MATLAB
!   // if(tmp==NULL)
!   // else OCTAVE
! 	if(tmp==NULL || mxIsEmpty(tmp))
! 	// endif
      flag = 0;
    else
      {
diff -c -r spike/shared/hist_mx.c spike.oct/shared/hist_mx.c
*** spike/shared/hist_mx.c	2006-12-01 13:42:16.000000000 -0500
--- spike.oct/shared/hist_mx.c	2007-03-12 15:41:04.000000000 -0400
***************
*** 84,92 ****
    for(m=0;m<M;m++)
      {
        /* Read in scalars */
!       hist_c[m].P = mxGetScalar(mxGetField(hist_mx,m,"P"));
!       hist_c[m].C = mxGetScalar(mxGetField(hist_mx,m,"C"));
!       hist_c[m].N = mxGetScalar(mxGetField(hist_mx,m,"N"));
  
        /* Read in matrices */
        hist_c[m].wordcnt = mxGetPr(mxGetField(hist_mx,m,"wordcnt"));
--- 84,92 ----
    for(m=0;m<M;m++)
      {
        /* Read in scalars */
!       hist_c[m].P = (int)mxGetScalar(mxGetField(hist_mx,m,"P"));
!       hist_c[m].C = (int)mxGetScalar(mxGetField(hist_mx,m,"C"));
!       hist_c[m].N = (int)mxGetScalar(mxGetField(hist_mx,m,"N"));
  
        /* Read in matrices */
        hist_c[m].wordcnt = mxGetPr(mxGetField(hist_mx,m,"wordcnt"));
diff -c -r spike/shared/toolkit_mx.h spike.oct/shared/toolkit_mx.h
*** spike/shared/toolkit_mx.h	2006-12-01 13:42:16.000000000 -0500
--- spike.oct/shared/toolkit_mx.h	2007-03-12 15:41:04.000000000 -0400
***************
*** 7,13 ****
   *  at http://neurodatabase.org/src/license.
   */
  #include "mex.h"
! #include "matrix.h"
  #include "hist_mx.h"
  #include "gen_mx.h"
  #include "../input/input_mx.h"
--- 7,13 ----
   *  at http://neurodatabase.org/src/license.
   */
  #include "mex.h"
! //#include "matrix.h"
  #include "hist_mx.h"
  #include "gen_mx.h"
  #include "../input/input_mx.h"
diff -c -r spike/staraster.m spike.oct/staraster.m
*** spike/staraster.m	2006-12-01 13:42:16.000000000 -0500
--- spike.oct/staraster.m	2007-03-12 16:30:01.000000000 -0400
***************
*** 51,78 ****
  
  %%% Now make the plot
  idx=1;
! cla;
  hold on;
! colororder = get(gca,'colororder');
  num_colors = size(colororder,1);
  for m=1:X.M
    cur_color = colororder(mod(m-1,num_colors)+1,:);
    cur_start = idx;
    for p = 1:X.categories(m).P 
      list = X.sites(n).time_scale*X.categories(m).trials(p,n).list; 
!     h = plot(list,idx*ones(size(list)),'.');
      set(h,'color',cur_color);
      idx=idx+1;
    end
    cur_end = idx;
    h = text(((range(2)-range(1))/4)+range(1),(cur_start+cur_end)/2,X.categories(m).label);
!   set(h,'verticalalignment','middle','horizontalalignment','center');
  end
  hold off;
  box on;
  xlabel('Time (sec)');
  ylabel('Trial');
! title(strrep(X.sites(n).label,'_','\_'));
  set(gca,'ylim',[0 idx]);
  set(gca,'ydir','rev');
  set(gca,'xlim',[range(1) range(2)]);
--- 51,83 ----
  
  %%% Now make the plot
  idx=1;
! warning("octave!=matlab :: axis uncleared b/c 'cla' seems broken");
! %cla;
  hold on;
! warning("octave!=matlab :: colors set manually b/c gca has no member 'colororder'");
! %colororder = get(gca,'colororder');
! colororder = [0 0 0;0 0 1;1 0 0;0 1 0;1 0 1;1 1 0;0 1 1;.5 .5 .5];
  num_colors = size(colororder,1);
  for m=1:X.M
    cur_color = colororder(mod(m-1,num_colors)+1,:);
    cur_start = idx;
    for p = 1:X.categories(m).P 
      list = X.sites(n).time_scale*X.categories(m).trials(p,n).list; 
!     h = plot(list,idx*ones(size(list)),'o');
      set(h,'color',cur_color);
      idx=idx+1;
    end
    cur_end = idx;
    h = text(((range(2)-range(1))/4)+range(1),(cur_start+cur_end)/2,X.categories(m).label);
! 	warning("octave!=matlab :: axis text not aligned b/c text handles have no member 'verticalalignment' or 'horizontalalignment'");
!   %set(h,'verticalalignment','middle','horizontalalignment','center');
  end
  hold off;
  box on;
  xlabel('Time (sec)');
  ylabel('Trial');
! warning("octave!=matlab :: title adjusted b/c strrep() deals w/ cells{} differently");
! title(strrep(X.sites(n).label{1},'_','\_'));
  set(gca,'ylim',[0 idx]);
  set(gca,'ydir','rev');
  set(gca,'xlim',[range(1) range(2)]);
