Mercurial > hg > camir-aes2014
comparison toolboxes/MIRtoolbox1.3.2/MIRToolbox/@mirspectrum/set.m @ 0:e9a9cd732c1e tip
first hg version after svn
author | wolffd |
---|---|
date | Tue, 10 Feb 2015 15:05:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e9a9cd732c1e |
---|---|
1 function ss = set(s,varargin) | |
2 % SET Set properties for the MIRspectrum object | |
3 % and return the updated object | |
4 | |
5 propertyArgIn = varargin; | |
6 ph = s.phase; | |
7 log = s.log; | |
8 pow = s.pow; | |
9 xs = s.xscale; | |
10 d = mirdata(s); | |
11 d = set(d,'Title',get(s,'Title'),'Abs',get(s,'Abs'),'Ord',get(s,'Ord')); | |
12 while length(propertyArgIn) >= 2, | |
13 prop = propertyArgIn{1}; | |
14 val = propertyArgIn{2}; | |
15 propertyArgIn = propertyArgIn(3:end); | |
16 switch prop | |
17 case 'Magnitude' | |
18 d = set(d,'Data',val); | |
19 case 'Frequency' | |
20 d = set(d,'Pos',val); | |
21 case 'Phase' | |
22 ph = val; | |
23 case 'log' | |
24 log = val; | |
25 case 'XScale' | |
26 xs = val; | |
27 case 'Power' | |
28 pow = val; | |
29 otherwise | |
30 d = set(d,prop,val); | |
31 end | |
32 end | |
33 ss.phase = ph; | |
34 ss.log = log; | |
35 ss.xscale = xs; | |
36 ss.pow = pow; | |
37 ss = class(ss,'mirspectrum',d); |