Using
x=-10:0.1:10f=x+2
in basic m-file works fine.
But now I am trying to draw a plot using GUI, and by inputing a function.It gives me bunch of errors. Could anyone explain how I can give values to the y when I have the range of x set?
% --- Executes on button press in zimet.function zimet_Callback(hObject, eventdata, handles)% hObject handle to zimet (see GCBO)% eventdata reserved - to be defined in a future version of MATLAB% handles structure with handles and user data (see GUIDATA)x=-10:0.1:10;f=inline(get(handles.vdj,'string'))y(x)=faxes(handles.axes)plot(x,y)color=get(handles.listbox, 'value')switch color case 2 set(plot(x,y),'color', 'r') case 3 set(plot(x,y),'color', 'g') case 4 set(plot(x,y),'color', 'b')endstyle=get(handles.popupmenu, 'value')switch style case 2 set(plot(x,y), 'linestyle','--') case 3 set(plot(x,y), 'linestyle','-.') case 4 set(plot(x,y), 'linestyle',':')endrezgis=get(handles.grid, 'value')switch rezgis case 1 grid on case 2 grid offend