Notice in all the other functions you pass in handles which allows you to access the data inside
slider1_Callback(hObject, eventdata, handles)
In your return function. You are not passing handles into it, so it doesn't know what handles is. In fact, you are not passing anything into it or out of it.
Imagine your functions have no idea what is available even in the workspace before calling them unless you tell them/give it to them. You will need to pass handles into the function so that it can access it.
maybe even something simple like below would help on the path of fixing.
Edit: Somehow I only read through your error message and didn't read the last line.
" try to add (hObject, eventdata, handles) to result function, but it doesn`t help. "
If adding that didn't help, I don't know that my solution would help either because extra inputs shouldn't matter.
Best Answer