Hi, Guys. I want to change the vertical line position by a slider. The codes as follows.
function slider_wf_Callback(hObject, eventdata, handles)% hObject handle to slider_wf (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: get(hObject,'Value') returns position of slider
% get(hObject,'Min') and get(hObject,'Max') to determine range of slider
global FLAG_DATA_LOADED;if FLAG_DATA_LOADED == 1 slider_value = int32(get(hObject,'Value')); set(handles.text_cur_frame_num, 'String',num2str(slider_value)); axes(handles.axes_waveform); h = vline(slider_value/20, 'r-');endguidata(hObject, handles);
However, when I moved the slider, the previous lines still existed. How to solve this problem?Thanks in advance.
Best Answer