MATLAB: Convert code to GUI

funcion

how i can have the result of this code after bush the button i am a student please help me
i put the code on callback function but doesnt work
% --- Executes on button press in pushbutton5.
function pushbutton5_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton5 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
i=1;
j=1;
nablus=[119.400000000000,107.700000000000,102.900000000000,88.9000000000000,74.1000000000000,51.5000000000000;70,63.4000000000000,60.8000000000000,53.1000000000000,44.8000000000000,32.3000000000000;55.1000000000000,50,47.9000000000000,41.9000000000000,35.5000000000000,25.8000000000000;34,30.9000000000000,29.6000000000000,26,22.1000000000000,16.2000000000000;21.8000000000000,20,19.2000000000000,17.1000000000000,14.8000000000000,11.3000000000000;14.7000000000000,13.5000000000000,13,11.6000000000000,10.1000000000000,7.70000000000000;11,10.3000000000000,10,9.10000000000000,8.10000000000000,6.70000000000000;7.60000000000000,7.10000000000000,6.90000000000000,6.30000000000000,5.70000000000000,4.70000000000000;5.10000000000000,4.70000000000000,4.60000000000000,4.10000000000000,3.60000000000000,2.90000000000000];
beitdagan=[85.8000000000000,77.3000000000000,72.9000000000000,63.4000000000000,52.6000000000000,36.1000000000000;49,44.5000000000000,42.2000000000000,37.2000000000000,31.4000000000000,22.7000000000000;41.7000000000000,37.5000000000000,35.4000000000000,30.7000000000000,25.4000000000000,17.4000000000000;27.4000000000000,24.6000000000000,23.2000000000000,20.1000000000000,16.6000000000000,11.2000000000000;16.4000000000000,14.8000000000000,14,12.3000000000000,10.4000000000000,7.40000000000000;10.3000000000000,9.40000000000000,9,8,6.90000000000000,5.20000000000000;7.50000000000000,7,6.70000000000000,6.10000000000000,5.40000000000000,4.30000000000000;5.10000000000000,4.80000000000000,4.60000000000000,4.20000000000000,3.70000000000000,3;3.50000000000000,3.20000000000000,3.10000000000000,2.80000000000000,2.40000000000000,1.90000000000000];
tubas=[71.5000000000000,65,63.3000000000000,56.5000000000000,49.4000000000000,38.6000000000000;42.6000000000000,38.9000000000000,37.9000000000000,34.1000000000000,30.1000000000000,24.1000000000000;28.8000000000000,26.4000000000000,25.8000000000000,23.3000000000000,20.7000000000000,16.7000000000000;19.5000000000000,17.7000000000000,17.3000000000000,15.4000000000000,13.5000000000000,10.6000000000000;13.5000000000000,12.2000000000000,11.9000000000000,10.6000000000000,9.30000000000000,7.20000000000000;9.80000000000000,8.80000000000000,8.60000000000000,7.50000000000000,6.40000000000000,4.80000000000000;7.60000000000000,6.90000000000000,6.70000000000000,6,5.20000000000000,4;4.40000000000000,4.10000000000000,4.10000000000000,3.80000000000000,3.60000000000000,3.20000000000000;3.70000000000000,3.30000000000000,3.30000000000000,2.90000000000000,2.60000000000000,2];
tulluza=[99.7000000000000,89.2000000000000,84.9000000000000,72.6000000000000,59.4000000000000,39.3000000000000;61.9000000000000,55.6000000000000,53.1000000000000,45.7000000000000,37.8000000000000,25.8000000000000;44.4000000000000,40.3000000000000,38.6000000000000,33.8000000000000,28.6000000000000,20.8000000000000;29.6000000000000,26.8000000000000,25.6000000000000,22.3000000000000,18.8000000000000,13.4000000000000;19.2000000000000,17.5000000000000,16.9000000000000,14.9000000000000,12.8000000000000,9.70000000000000;13.3000000000000,12.3000000000000,11.8000000000000,10.6000000000000,9.30000000000000,7.30000000000000;11.2000000000000,10.3000000000000,9.90000000000000,8.80000000000000,7.60000000000000,5.90000000000000;8.10000000000000,7.40000000000000,7.20000000000000,6.40000000000000,5.60000000000000,4.40000000000000;5,4.60000000000000,4.50000000000000,4,3.60000000000000,2.90000000000000];
tummon=[64,58,55.4000000000000,48.3000000000000,40.7000000000000,29.1000000000000;39.1000000000000,35.6000000000000,34,29.8000000000000,25.4000000000000,18.6000000000000;31.6000000000000,28.7000000000000,27.5000000000000,24,20.4000000000000,14.8000000000000;19.8000000000000,17.9000000000000,17.1000000000000,14.9000000000000,12.6000000000000,9;11.6000000000000,10.6000000000000,10.2000000000000,9.10000000000000,7.90000000000000,6.10000000000000;7,6.50000000000000,6.30000000000000,5.70000000000000,5.10000000000000,4.20000000000000;5.40000000000000,5.10000000000000,4.90000000000000,4.60000000000000,4.20000000000000,3.60000000000000;4,3.70000000000000,3.60000000000000,3.30000000000000,3,2.50000000000000;2.70000000000000,2.50000000000000,2.40000000000000,2.20000000000000,1.90000000000000,1.50000000000000];
s6=[35.1000000000000,32,30.9000000000000,27.3000000000000,23.4000000000000,17.6000000000000;20.1000000000000,18.5000000000000,17.9000000000000,16,13.9000000000000,10.9000000000000;16.9000000000000,15.4000000000000,14.9000000000000,13.1000000000000,11.2000000000000,8.40000000000000;11.1000000000000,10,9.70000000000000,8.50000000000000,7.20000000000000,5.20000000000000;6.90000000000000,6.30000000000000,6.10000000000000,5.40000000000000,4.60000000000000,3.50000000000000;4.20000000000000,3.90000000000000,3.80000000000000,3.40000000000000,3,2.40000000000000;3.10000000000000,2.90000000000000,2.80000000000000,2.60000000000000,2.40000000000000,2;2.10000000000000,2,1.90000000000000,1.80000000000000,1.60000000000000,1.40000000000000;1.40000000000000,1.30000000000000,1.30000000000000,1.20000000000000,1.10000000000000,0.900000000000000];
s7=[116.500000000000,104.900000000000,100.900000000000,87.4000000000000,73.1000000000000,51.5000000000000;67.2000000000000,61.1000000000000,59,51.8000000000000,44.3000000000000,32.9000000000000;55.5000000000000,50,48.1000000000000,41.7000000000000,35,24.7000000000000;35.4000000000000,31.9000000000000,30.7000000000000,26.6000000000000,22.3000000000000,15.8000000000000;22.4000000000000,20.3000000000000,19.6000000000000,17.2000000000000,14.7000000000000,10.9000000000000;14.3000000000000,13.1000000000000,12.7000000000000,11.3000000000000,9.80000000000000,7.60000000000000;10.6000000000000,9.80000000000000,9.60000000000000,8.70000000000000,7.80000000000000,6.40000000000000;7.20000000000000,6.80000000000000,6.60000000000000,6,5.40000000000000,4.50000000000000;4.90000000000000,4.50000000000000,4.40000000000000,4,3.50000000000000,2.80000000000000];
s8=[117.100000000000,105.700000000000,101.700000000000,88.3000000000000,74.2000000000000,52.9000000000000;67.4000000000000,61.4000000000000,59.3000000000000,52.2000000000000,44.8000000000000,33.5000000000000;56.2000000000000,50.7000000000000,48.8000000000000,42.4000000000000,35.6000000000000,25.4000000000000;36.4000000000000,32.8000000000000,31.5000000000000,27.3000000000000,22.8000000000000,16;22.9000000000000,20.8000000000000,20.1000000000000,17.6000000000000,15,11;14.3000000000000,13.1000000000000,12.7000000000000,11.3000000000000,9.90000000000000,7.70000000000000;10.6000000000000,9.80000000000000,9.60000000000000,8.70000000000000,7.80000000000000,6.50000000000000;7.20000000000000,6.70000000000000,6.60000000000000,6,5.40000000000000,4.50000000000000;4.90000000000000,4.50000000000000,4.40000000000000,4,3.50000000000000,2.80000000000000];
s9=[115.600000000000,105.400000000000,101.800000000000,89.9000000000000,77.2000000000000,58.1000000000000;66.3000000000000,61,59.1000000000000,52.8000000000000,46.1000000000000,36.1000000000000;55.4000000000000,50.4000000000000,48.7000000000000,42.9000000000000,36.8000000000000,27.6000000000000;35.5000000000000,32.3000000000000,31.1000000000000,27.3000000000000,23.3000000000000,17.2000000000000;22.2000000000000,20.4000000000000,19.7000000000000,17.5000000000000,15.1000000000000,11.6000000000000;14,13,12.6000000000000,11.4000000000000,10.1000000000000,8.10000000000000;10.3000000000000,9.70000000000000,9.40000000000000,8.70000000000000,7.90000000000000,6.60000000000000;7,6.60000000000000,6.50000000000000,6,5.40000000000000,4.70000000000000;4.80000000000000,4.50000000000000,4.40000000000000,4,3.60000000000000,2.90000000000000];
s10=[81.7000000000000,73.2000000000000,70.3000000000000,60.3000000000000,49.9000000000000,34;47.3000000000000,42.8000000000000,41.3000000000000,36,30.5000000000000,22.1000000000000;38.6000000000000,34.7000000000000,33.3000000000000,28.7000000000000,23.9000000000000,16.6000000000000;24,21.7000000000000,20.8000000000000,18.1000000000000,15.2000000000000,10.8000000000000;15.4000000000000,14,13.5000000000000,11.8000000000000,10.1000000000000,7.50000000000000;10.1000000000000,9.20000000000000,8.90000000000000,7.90000000000000,6.80000000000000,5.10000000000000;7.50000000000000,7,6.80000000000000,6.20000000000000,5.50000000000000,4.50000000000000;5.10000000000000,4.80000000000000,4.70000000000000,4.30000000000000,3.80000000000000,3.20000000000000;3.50000000000000,3.20000000000000,3.10000000000000,2.80000000000000,2.40000000000000,1.90000000000000];
s11=[49.4000000000000,44.3000000000000,42.6000000000000,36.7000000000000,30.5000000000000,21;28.6000000000000,25.9000000000000,25,21.9000000000000,18.6000000000000,13.6000000000000;23.4000000000000,21.1000000000000,20.3000000000000,17.5000000000000,14.6000000000000,10.2000000000000;14.6000000000000,13.2000000000000,12.7000000000000,11,9.20000000000000,6.60000000000000;9.30000000000000,8.50000000000000,8.20000000000000,7.20000000000000,6.20000000000000,4.60000000000000;6.10000000000000,5.60000000000000,5.40000000000000,4.80000000000000,4.10000000000000,3.20000000000000;4.50000000000000,4.20000000000000,4.10000000000000,3.70000000000000,3.30000000000000,2.70000000000000;3.10000000000000,2.90000000000000,2.80000000000000,2.60000000000000,2.30000000000000,1.90000000000000;2.10000000000000,1.90000000000000,1.90000000000000,1.70000000000000,1.50000000000000,1.20000000000000];
s12=[39.6000000000000,35.5000000000000,34.1000000000000,29.3000000000000,24.3000000000000,16.6000000000000;22.9000000000000,20.8000000000000,20,17.5000000000000,14.8000000000000,10.8000000000000;18.7000000000000,16.8000000000000,16.2000000000000,14,11.6000000000000,8.10000000000000;11.7000000000000,10.5000000000000,10.1000000000000,8.80000000000000,7.40000000000000,5.20000000000000;7.50000000000000,6.80000000000000,6.50000000000000,5.70000000000000,4.90000000000000,3.60000000000000;4.90000000000000,4.50000000000000,4.30000000000000,3.80000000000000,3.30000000000000,2.50000000000000;3.60000000000000,3.40000000000000,3.30000000000000,3,2.70000000000000,2.20000000000000;2.50000000000000,2.30000000000000,2.30000000000000,2.10000000000000,1.90000000000000,1.50000000000000;1.70000000000000,1.60000000000000,1.50000000000000,1.40000000000000,1.20000000000000,0.900000000000000];
s13=[43.4000000000000,38.6000000000000,36.9000000000000,31.2000000000000,25.2000000000000,16.2000000000000;26.2000000000000,23.5000000000000,22.5000000000000,19.4000000000000,16.1000000000000,11.1000000000000;20.9000000000000,18.7000000000000,17.9000000000000,15.2000000000000,12.4000000000000,8.20000000000000;13.1000000000000,11.8000000000000,11.3000000000000,9.70000000000000,7.90000000000000,5.30000000000000;8.80000000000000,8,7.70000000000000,6.70000000000000,5.70000000000000,4.10000000000000;6.10000000000000,5.80000000000000,5.70000000000000,5.30000000000000,4.80000000000000,4.20000000000000;5,4.70000000000000,4.60000000000000,4.20000000000000,3.90000000000000,3.30000000000000;3.50000000000000,3.30000000000000,3.20000000000000,2.90000000000000,2.70000000000000,2.30000000000000;2.10000000000000,2,1.90000000000000,1.70000000000000,1.50000000000000,1.20000000000000];
s14=[34,30.8000000000000,29.7000000000000,26,22,16.1000000000000;19.5000000000000,17.8000000000000,17.2000000000000,15.3000000000000,13.2000000000000,10.1000000000000;16.5000000000000,14.9000000000000,14.4000000000000,12.5000000000000,10.6000000000000,7.60000000000000;11,9.90000000000000,9.50000000000000,8.20000000000000,6.90000000000000,4.80000000000000;6.80000000000000,6.20000000000000,6,5.20000000000000,4.50000000000000,3.30000000000000;4.10000000000000,3.80000000000000,3.70000000000000,3.30000000000000,2.90000000000000,2.30000000000000;3,2.80000000000000,2.80000000000000,2.50000000000000,2.30000000000000,1.90000000000000;2.10000000000000,1.90000000000000,1.90000000000000,1.70000000000000,1.60000000000000,1.30000000000000;1.40000000000000,1.30000000000000,1.30000000000000,1.20000000000000,1,0.800000000000000];
xRstations=[178000;178005.881000000;184954.217000000;185300;186500;196000;181173.964000000;181635.951000000;184058.465000000;188253.551000000;193430.538000000;196643.722000000;193001.835000000;198711.722000000];
yRstations=[178000;186301.557000000;191684.992000000;177800;187800;172000;179700.846000000;189910.442000000;185124.500000000;181697.528000000;175454.368000000;167398.785000000;179575.162000000;163558.214000000];
for i=1:9;
for j=1:6;
Vc(1)=nablus(i,j);
Vc(2)=tulluza(i,j);
Vc(3)=tubas(i,j);
Vc(4)=beitdagan(i,j);
Vc(5)=tummon(i,j);
Vc(6)=s6(i,j);
Vc(7)=s7(i,j);
Vc(8)=s8(i,j);
Vc(9)=s9(i,j);
Vc(10)=s10(i,j);
Vc(11)=s11(i,j);
Vc(12)=s12(i,j);
Vc(13)=s13(i,j);
Vc(14)=s14(i,j);
Vi(i,j) = gIDW(xRstations,yRstations,Vc,x,y,-2);
end
end
vi
it told me the function nor defined

Best Answer

Your loop creates Vi with a capital V, but at the end tries to look at vi with lower-case v
Also note that gIDW needs to be installed from the File Exchange contribution