function output=searchstring(strarray,variable)
% Script to find a specified string within a 1D cell array.  Searchs cell by
% cell and outputs a list of matching columns.
% Input= p=searchstring(array,'variable')

variable=cellstr(variable); %convert to cell
count2=1;
output=NaN(1,length(strarray)); %predefine

for count=1:length(strarray)
    if strcmp(strarray(1,count),variable)==1 %compare two cells
        output(1,count2)=count;
    count2=count2+1;
    end
end

% remove NaNs
l=find(isnan(output)==0);
output=output(l);

if isempty(output)==1
%output='no matches found'
[]
end
