clc, clear all

str = input('Input string ','s');
s =   input('Input a character to search: ','s');

cnt = 0;
for ii=1:numel(str)
	if(strcmp(str(ii),s))
		cnt = cnt + 1;
	end
end

cnt
