You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: Programs_18c.m
    path of file: ./repos/Dynamical-Systems-with-Applications-using-MATLAB/Lynch R2016a
    
    the code of the file until where you have to start completion: % Programs 18c - The Hopfield Network Used as an Associative Memory.
% Chapter 18 - Neural Networks.
% Copyright Birkhauser 2013. Stephen Lynch
    
function plotHopfieldVector(x)
cla;
numInputs = length(x);
numRows = ceil(sqrt(numInputs));
numCols = ceil(numInputs/numRows);
for m=1:numRows
   for n=1:numCols
      xind = numRows*(m-1)+n;
      if xind > numInputs
         break;
      elseif x(xind)==1
         rectangle('Position', [n-1 numRows-m 1 1], 'FaceColor', 'k');
      elseif x(xind)==-1
         rectangle('Position', [n-1 numRows-m 1 1], 'FaceColor', 'w');         
      end