Line | |
---|
1 | % 'filter_band.m': plot a field after band filtering in the GUI get_field |
---|
2 | % GUI_input=filter_band(hget_field) |
---|
3 | % |
---|
4 | % OUTPUT: |
---|
5 | % GUI_input: option for display in the GUI get_field |
---|
6 | % |
---|
7 | %INPUT: |
---|
8 | % hget_field: handles of the GUI get_field |
---|
9 | % |
---|
10 | function filter_band(Field,hget_field) |
---|
11 | |
---|
12 | if ~isempty(VarIndex.x) |
---|
13 | VarName_x=Field.ListVarName{VarIndex.x}; |
---|
14 | end |
---|
15 | |
---|
16 | prompt={'selected period (nbre of points)'}; |
---|
17 | def={'10'}; |
---|
18 | dlgTitle='primary period'; |
---|
19 | lineNo=1; |
---|
20 | answer=inputdlg(prompt,dlgTitle,lineNo,def); |
---|
21 | period=round(str2num(answer{1})); |
---|
22 | filt_vector=ones(1,period)/period;% averaging vector |
---|
23 | VarName_y=Field.ListVarName(VarIndex.y); |
---|
24 | % hfig |
---|
25 | if isempty(str2num(hfig)) |
---|
26 | figure |
---|
27 | else |
---|
28 | figure(str2num(hfig)) |
---|
29 | end |
---|
30 | for ivar=1:length(VarName_y) |
---|
31 | eval(['Var= filter(filt_vector,1,Field.' VarName_y{ivar} ');']); |
---|
32 | |
---|
33 | plot(Var) |
---|
34 | grid on |
---|
35 | hold on |
---|
36 | end |
---|
37 | |
---|
38 | |
---|
Note: See
TracBrowser
for help on using the repository browser.