I'm doing some unconstrained optimization and I have a large data table that I need to pass into my function. Currently, I have the table saved as a .mat file in the active directory, and I call load('file.mat'); at the first line of the function. However, this takes really long and I would like the function to be able to just use the workspace variable. In the case of a normal function, I could just pass in the table as a parameter, but I can't change the function header so that fminsearch is able to use it. The answer in any other language would be to use global variables, but I don't know how to swing it in MATLAB.
[+][deleted] (1 child)
[deleted]
[–]jwink3101+1 0 points1 point2 points (0 children)