tomwalters@0: % method of class @signal tomwalters@0: % tomwalters@0: % INPUT VALUES: tomwalters@0: % tomwalters@0: % RETURN VALUE: tomwalters@0: % tomwalters@0: % bleeck@3: % This external file is included as part of the 'aim-mat' distribution package bleeck@3: % (c) 2011, University of Southampton bleeck@3: % Maintained by Stefan Bleeck (bleeck@gmail.com) bleeck@3: % download of current version is on the soundsoftware site: bleeck@3: % http://code.soundsoftware.ac.uk/projects/aimmat bleeck@3: % documentation and everything is on http://www.acousticscale.org bleeck@3: tomwalters@0: tomwalters@0: function sig=setvalues(org_sig,new_vals,startint) tomwalters@0: %usage: sig=setvalues(si,new,vals) tomwalters@0: % sets all values of the signal org_sig to the new values tomwalters@0: % if only one value is given, than all vals are set to this value tomwalters@0: tomwalters@0: if getnrpoints(org_sig)~=max(size(new_vals)) & nargin < 3 tomwalters@0: disp('error: setvalues: different size of signal and new values'); tomwalters@0: end tomwalters@0: tomwalters@0: if nargin < 3 tomwalters@0: startint=1; tomwalters@0: end tomwalters@0: tomwalters@0: if length(new_vals)==1 tomwalters@0: len=getnrpoints(org_sig)-startint+1; tomwalters@0: new_vals=ones(len,1)*new_vals; tomwalters@0: end tomwalters@0: if size(new_vals,1)< size(new_vals,2) tomwalters@0: new_vals=new_vals'; tomwalters@0: end tomwalters@0: tomwalters@0: len=size(new_vals,1); tomwalters@0: tomwalters@0: nval=org_sig.werte; tomwalters@0: nval(startint:startint+len-1)=new_vals; tomwalters@0: org_sig.werte=nval; tomwalters@0: sig=org_sig; tomwalters@0: