Hello,
I am writing a gui program using Guide. In one of the functions I am trying to allow the user to load in a filter created using the fdatool. Using this then be able to filter a signal through this. It is meant to not force them to modify the code any time they want to use a different filter.
When Filter is displayed it simply shows the name of the filter, where as Filter1 displays the structure for bpass697hz, I need to get Filter to do the same.
Ive tried things like using load, uiimport, and some other approaches which escape me at the moment. Id greatly appreciate any help and will gladly clarify anything that seems unclear.
I am writing a gui program using Guide. In one of the functions I am trying to allow the user to load in a filter created using the fdatool. Using this then be able to filter a signal through this. It is meant to not force them to modify the code any time they want to use a different filter.
Rich (BB code):
% --- Executes on button press in pushbutton2.
function pushbutton2_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[file,path]=uigetfile; %Obtain file and path information
file=strrep(file,'.m',''); %remove .m from filter name
Filter=file
Signal = handles.Signal_Temp; %load signal to be filtered
Signal = typecast(Signal,'single'); %ensure signal is of type 'float' or 'single'
Filter1 = bpass697hz
Signal_Temp = filter(Filter1,Signal); %Apply filter to signal
guidata(hObject,handles);
When Filter is displayed it simply shows the name of the filter, where as Filter1 displays the structure for bpass697hz, I need to get Filter to do the same.
Ive tried things like using load, uiimport, and some other approaches which escape me at the moment. Id greatly appreciate any help and will gladly clarify anything that seems unclear.