1) Convert your code into a function.
2) Create a GUI element for every input to your function. I would use "GUIDE".
3) When you open the script corresponding to the GUI, most elements should tell you how to access the input, something like:
get(hObject,'Value')
and assign that to a global variable:
global param1
param1 = get(hObject,'Value');
4) Create a RUN button on the GUI. Go to the buttons script and add something like:
global param1
global param2
global param3
global result
result = myfunction(param1,param2,param3);
5) Create an element to display your result, then set the value for it, with something like:
global result
set(hObject,'Value',result)
There is a way to not use any global variables to do this, but since you are asking this question, I am assuming you want an answer you can understand, rather than an answer that is neat.
