I have an algorithm written in one m file and i have several functions that i created in another .m file. I want to call these several functions i created in a separated file from the main algorithm .m file. I know how to call one function from a file to another, but here i want to be calling different functions i created in a separate file from my mail algorithm file. I have searched here, but the answers i got does not help and are not talking about what i want.
Here is a little illustration of what i am talking about:
main algo file
N = 30;
x = -10 + 20rand(1,N)
for j = 1 to N
c = f1(x) % here i need to call different functions from another file
end
Functions with several variable- this is a separate file
Function perform
%% Function F1
f = f1(x)
statements
end
%% Function F2
f = f2(x)
statements
end
%% Function F3
f = f3(x)
statements
end
%% Function F4
f = f4(x)
statements
end
%% Function F5
f = f5(x)
statements
end
end Perform
I want to be calling the F1 to F4 in the main algo .m file. How can you do this. Also it will be better if each time i run the main algo .m file, it prompts me to choose which of the F1 to F4 function i want to call and one i inputs and indicate the function in a dailog box, it calls that particular function. Any idea on how to do this please?