I have 2 functions with same names in 2 different folders A and B. Lets call the function as func.m
I have another main program where I will be calling this function.
I want to specify the folder from which func() will be used from.
addpath causes the added path to remain until the matlab session is closed and rmpath can be used to remove the path but it causes issues at times by accessing the wrong folder.
Is is possible to addpaths that will be used only when the script is run ? I don't want the path to be there for the entire matlab session.