File size: 385 Bytes
3d95f7a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
% function checking if a specific file is a script%

function bool = isscript(fileName);

fid = fopen(fileName, 'r');
cont = true;
while cont && ~feof(fid)
    l = strtok(fgetl(fid));
    
    if ~isempty(l) && l(1) ~= '%'
        if strcmpi(l, 'function')
            bool = false; return;
        else
            bool = true; return;
        end;
    end;
end;
bool = true; return;