pb_lookup.m 835 Bytes
Newer Older
Jesse Heckman's avatar
Jesse Heckman committed
1
2
3
4
5
6
7
8
function array = pb_lookup(array, varargin)
% PB_LOOKUP()
%
% PB_LOOKUP()  ...
%
% See also ...

% PBToolbox (2018): JJH: j.heckman@donders.ru.nl
Jesse Heckman's avatar
Jesse Heckman committed
9
10
11
12
   
   fn    = pb_keyval('fn',varargin,[]); [~,sheets] = xlsfinfo(fn);
   sheet = pb_keyval('sheet',varargin,sheets{end}); 
   
Jesse Heckman's avatar
Jesse Heckman committed
13
   if nargin == 0; return; end
Jesse Heckman's avatar
Jesse Heckman committed
14
   if isempty(fn); return; end
Jesse Heckman's avatar
Jesse Heckman committed
15
   
Jesse Heckman's avatar
Jesse Heckman committed
16
17
18
19
   [num,~,~] = xlsread(fn,sheet);
   
   for i = 1:numel(array)
      array(i) = num(num(:,1)==array(i),2);
Jesse Heckman's avatar
Jesse Heckman committed
20
21
   end
end
Jesse Heckman's avatar
Jesse Heckman committed
22

Jesse Heckman's avatar
Jesse Heckman committed
23
24
25
26
27
28
29
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % 
%                                                           %
%       Part of Programmeer Beer Toolbox (PBToolbox)        %
%       Written by: Jesse J. Heckman (2018)                 %
%                                                           %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %