I am fairly new to matlab and am creating a GUI in which I need to use the brush function, which initiates upon button press "Window", to select a certain range on a graph and then with the press of a separate button "Perform Transform", use the brushed data that was selected as an input for a wavelet transform.
It is my goal to then have a popupmenu ("Select Wavelet") for which the user can select the wavelet to be used in the wavelet transform. In other words I would also need the choice picked from the string in the popupmenu to also be implemented into the seperate button press ("Perform Trasform").
So far, I have this for the "window" button press that allows the user to use the brush data. I ended it with guidata hoping that this would allow me to access the data in the other pushbutton.
_________________________
function Window1_pushbutton_Callback(hObject, eventdata, handles)
brush on pause hBrushLine = findall(gca,'tag','Brushing'); brushedData = get(hBrushLine, {'Xdata','Ydata'}); brushedIdx = ~isnan(brushedData{1}); brushedYData = brushedData{2}(brushedIdx);
ecgDWT1(:,1)=resampad(brushedYData);
handles.ecgDWT1 = ecgDWT1;
plot(handles.QRS1_axes,ecgDWT1); set(handles.QRS1_axes,'XMinorTick','on','xlim',[1 304]);
guidata(hObject,handles.ecgDWT1); brush off
________________________________________
Next, for the "Perform Transform" it begins as follows (This button alsotakes the mean and standard deviation and plots the results but the error seems to be coming from the beginning):
________________________________________
function dwt1_pushbutton_Callback(hObject, eventdata, handles)
ecgDWT1=guidata(handles.ecgDWT1); [C,L]=wavedec(ecgDWT1,4,dmey);%Compute Multi-level DWT.
....