0001 function block = get_internal_doc_block(fname,fpath)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023 block = [];
0024
0025
0026 mid = fopen([fpath '/' fname '.m'],'r');
0027
0028
0029 file = textscan(mid,'%s','delimiter','\n');
0030 file = file{1};
0031
0032
0033 fclose(mid);
0034
0035
0036 b1 = find(strncmp(file,'%@info:',7))+1;
0037 b2 = find(strncmp(file,'%@eod:',6))-1;
0038 b = find(strncmp(file,'%!',2));
0039
0040 if ( isempty(b1) && isempty(b2) && isempty(b) )
0041
0042 return
0043 else
0044 if ( (~isempty(b1) && isempty(b2) && isempty(b)) || ...
0045 (isempty(b1) && ~isempty(b2) && isempty(b)) || ...
0046 (isempty(b1) && isempty(b2) && ~isempty(b)) || ...
0047 (isempty(b1) && ~isempty(b2) && ~isempty(b)) || ...
0048 (~isempty(b1) && isempty(b2) && ~isempty(b)) || ...
0049 (~isempty(b1) && ~isempty(b2) && isempty(b)) )
0050 error('get_internal_doc_block:: There is a problem with the internal block definition!')
0051 end
0052 if ( b2~=b(end) || b1~=b(1) || any(b-transpose(b1:1:b2)) )
0053 error('get_internal_doc_block:: There is a problem with the internal block definition!')
0054 end
0055 end
0056
0057
0058 for i=b(1):1:b(end)
0059 str = file{i};
0060 block = char(block, str(3:end));
0061 end
0062 block = block(2:end,:);