MATLAB: Script to call functions

basicfunctionmain.mnew user

i would like to script a main.m that will offer choices of functions to run, 7 in all, where each function correlates to a number, 1:7.

Best Answer

function main
s=input('insert the function number: ')
switch s
case 1
fun1
case 2
fun2
case 3
fun3
case 4
fun4
case 5
fun5
case 6
fun6
case 7
fun7
otherwise
disp('Error, you must insert number from 1 to 7')
end