function charnum=char_counter(fname,character)fid=fopen(fname,'rt')if fid<0charnum=-1;return;endif fid ~=0 && ischar(character)==truecharnum=count(fname,"character ");elsecharnum=-1;end
MATLAB: Text file i/o problem….I always get 0 with charnum …whats the problem with the code?
text file
Best Answer