Subdomain Posts
MatLab | 385 days ago
MatLab | 385 days ago
MatLab | 388 days ago
None | 831 days ago
Recent Posts
PHP | 1 sec ago
None | 4 sec ago
None | 10 sec ago
None | 18 sec ago
None | 27 sec ago
PHP | 36 sec ago
None | 54 sec ago
None | 1 min ago
None | 1 min ago
None | 1 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
Learn a little bit about the new Pastebin.com on our help page. hide message
By Anonymous on the 27th of Feb 2009 04:38:48 PM Download | Raw | Embed | Report
  1. A = [0,0,1;0,1,1;0,0,0];
  2. [a,b] = size(A);
  3. for c = 1:1:(a-1)
  4.     for d = 1:1:(b-1)
  5.         adjacent_counter = 0;
  6.         for m = -1:1:1
  7.             for n = -1:1:1
  8.                 row_adjacent = m + c;
  9.                 col_adjacent = n + d;                
  10.                 if ( ( row_adjacent > 0 ) & ( col_adjacent > 0 ) )
  11.                     if ( A(row_adjacent,col_adjacent) == 1 )
  12.                         adjacent_counter = adjacent_counter + 1;
  13.                     end
  14.                 end
  15.             end
  16.         end
  17.         if adjacent_counter >= 3
  18.             A(c,d) = 1;
  19.         end
  20.         adjacent_counter = 0;
  21.     end
  22. end
Submit a correction or amendment below. Make A New Post
To highlight particular lines, prefix each line with @h@
Syntax highlighting:
Post expiration:
Post exposure:
Name / Title:
Email: