title: How to create a function that takes a matrix as an input?
body: <p>I am new to MatLab. </p>
  
  <p>Write a function that takes as input a matrix D ∈ R^(N×2), D_i = (x_i,y_i), and the period ω and returns a plot showing a fit of the data without noise.</p>
  
  <p>I need help with creating the function that takes the input as a matrix and period ω. Here is what I have so far. Am I on the right track? </p>
  
  <pre><code>function F = fftfuntion(D, omega)
  check = 0;
  x = D(:,1);
  y = D(;,2);
  </code></pre>