title: Populate matrix with ones according to certain function values
body: <p>I would like to populate a 10x10 matrix with ones at certain positions. For example eye(10) yields a matrix with ones along the diagonal, corresponding to a 45 degree vector if you will.</p>
  
  <p>Is it possible to create ones along the cells of let's say a 40 degree vector?
  My take on this would be to define a function like f(x) = -tan(40 deg) * x + 10 and match it with a matrix filled with zeros, creating ones where the function has function values.</p>
  
  <p>I'm not sure how to go about it though so any help is really appreciated. Thanks a lot.</p>
  
  <p>Peter</p>