title: fopen with correct file format and path
body: <p>How do I get to read my file with increment .htm  file with correct file format and path?</p>
  
  <pre><code>path:DATA\WEBPAGE_SOURCE\train75_phish_data\1.htm
  file:1.htm,2.htm,3.htm....etc
  </code></pre>
  
  <p>Inside 1.htm,2.htm,3.htm....etc are the soucre code of webpage</p>
  
  <p>I do try with the following example, but got the error when i=21.</p>
  
  <pre><code>data2=fopen(strcat('DATA\WEBPAGE_SOURCE\train75_phish_data\',int2str(i),'.htm'),'r')
  </code></pre>
  
  <p>I have refer to this, still cannot work, any ideas?
  <a href="http://www.mathworks.com/help/matlab/ref/fopen.html" rel="nofollow noreferrer">http://www.mathworks.com/help/matlab/ref/fopen.html</a></p>
  
  <p>Here is my code:</p>
  
  <pre><code>data = importdata('DATA/URL/trainURL')
  domain_URL = regexp(data,'\w*://[^/]*','match','once')
  
  [sizeData b] = size(domain_URL);
  
  for i = 1:150
  A7_data = domain_URL{i};
  
  data2=fopen(strcat('DATA\WEBPAGE_SOURCE\train75_phish_data\',int2str(i),'.htm'),'r')
  
  CharData = fread(data2, '*char')';  %read text file and store data in CharData
  img_only = regexp(CharData, '&lt;img.*?&gt;', 'match');
  
  feature7_data=(cellfun(@(n) isempty(n), strfind(img_only, A7_data))) 
  B7(i)=sum(feature7_data)
  
  
  end
  
  feature7(B7&gt;=10)=1;
  feature7(B7&lt;10&amp;B7&gt;5)=0;
  feature7(B7&lt;=5)=-1;
  
  feature7'
  </code></pre>
  
  <p>Here is my output:</p>
  
  <pre><code>data = importdata('DATA/URL/trainURL') is a list of URL being saved inside
  </code></pre>
  
  <p>I could not loop the results for i=20, it will come to error when iteration=21, I want to loop until 150, it cnt read the 'data2' for 'i=21'</p>
  
  <p><img src="https://i.stack.imgur.com/sPxyo.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/7HOSS.png" alt="enter image description here"></p>