title: How to pass a ".mat" file as an argument in Octave/Matlab
body: <p>I have a number of .mat files. I have written a short script where i use file1.mat and analyse the data. The next step in the process would be doing the same thing for file2.mat. One way to do this could be to simply copy my previous code and replace all the "file1.mat" with "file2.mat" and do the same for 3, 4.... However, I feel that there has to be a more elegant solution. The optimal situation would be if i could write a function that takes the filename (preferably not the whole path) as an argument. Is this possible?</p>
  
  <p>I have scurried the net and the closest I get is the "feval" function which works fine if i have .m files but not at all with .mat files. </p>
  
  <p><strong>Is there a way to pass .mat files to a matlab-function?</strong>  </p>