I am trying to write a function that will allow me to input a .dat file, which will then be read as the input for the function.
The code I have tried using is:
function beam_analysis(obj) clear all fid=fopen(obj,'r'); Title=fgets(fid);
Where the command would be:
beam_analysis('input.dat')
This is returning the error:
??? Reference to a cleared variable obj. Error in ==> beam_analysis at 4 fid=fopen(obj,'r');
Is there a better way to go about this? FYI – the input file is just a bunch of tables, in case you know of a better way of inputting this data. Thanks!
Best Answer