Mercurial > hg > ltpda
comparison m-toolbox/classes/@specwin/string.m @ 0:f0afece42f48
Import.
author | Daniele Nicolodi <nicolodi@science.unitn.it> |
---|---|
date | Wed, 23 Nov 2011 19:22:13 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:f0afece42f48 |
---|---|
1 % STRING writes a command string that can be used to recreate the input window object. | |
2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
3 % | |
4 % DESCRIPTION: STRING writes a command string that can be used to recreate the | |
5 % input window object. | |
6 % | |
7 % CALL: cmd = string(sw) | |
8 % | |
9 % VERSION: $Id: string.m,v 1.14 2011/05/23 20:33:04 mauro Exp $ | |
10 % | |
11 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
12 | |
13 function varargout = string(varargin) | |
14 | |
15 % Get specwin objects | |
16 sw = [varargin{:}]; | |
17 | |
18 if length(sw) > 1 | |
19 cmd = '['; | |
20 else | |
21 cmd = ''; | |
22 end | |
23 | |
24 for jj = 1:length(sw) | |
25 switch lower(sw(jj).type) | |
26 case 'kaiser' | |
27 cmd = [cmd ' specwin(''' sw(jj).type ''', ' num2str(sw(jj).len) ', ' num2str(sw(jj).psll) ')']; | |
28 case 'levelledhanning' | |
29 cmd = [cmd ' specwin(''' sw(jj).type ''', ' num2str(sw(jj).len) ', ' num2str(sw(jj).level) ')']; | |
30 otherwise | |
31 cmd = [cmd ' specwin(''' sw(jj).type ''', ' num2str(sw(jj).len) ')']; | |
32 end | |
33 end | |
34 | |
35 if length(sw) > 1 | |
36 cmd = [cmd ']']; | |
37 end | |
38 | |
39 % Set output | |
40 varargout{1} = cmd; | |
41 | |
42 end | |
43 |