I would like to have some file, myfunc.m
, in my MATLAB path and somehow load its contents into a MATLAB function block automatically just before the simulation starts. This way, I can use an external editor to write these embedded function, version control them separately as independent files, etc.
Is there a way to achieve this programmatically?
My initial attempt was to try and access the contents of the function block using something like get_param
, but I can't seem to gain read/write access to the code itself.