Hello! I have three files, 'originFile' which contains file1 and file2 , I would like to know how can I force Matlab to save the output files from funct1 in file1 into file1 and not in the 'originFile' ?!
Thank you!

Hi @Rik Wisselink, my code is spreaded out into two files file1 and file2 within each file there is some functions calling each other, and for organization purposes I would like to save the output files from functions in file1 in that same file.
Thank you!

Normally, if you have a subfunction in a file, functions outside of that file can not call that function. You can circumvent this with something like fh = str2func(fid);[varargout{1:nargout}] = fh(varargin{:});

In short, I can't really imagine a function structure that makes sense and works the way you describe.

Hello, I just wanted to add another alternative that worked for me for those who might face the same problem. I have added to the function funct1 ,which I would like to get its out put , the following code line: