title: variable amplitude sine wave matlab
body: <p>Attempting to generate a sine function with several different amplitude epochs withinf the same trace.</p>
  
  <p>For example, a 2Hz sine wave at amplitude 1 for 10 seconds, amplitude 10 for ten sceonds, then back to amplitude 1 for another ten seconds.</p>
  
  <p>I tried editing the example here: <a href="http://www.mathworks.se/help/slcontrol/ug/frest.sinestream.html" rel="nofollow">http://www.mathworks.se/help/slcontrol/ug/frest.sinestream.html</a>
  but got errors with the code:</p>
  
  <pre><code>input = frest.Sinestream('Frequency',[2 2 2],...
           'Amplitude',[1 10 1],...
           'FreqUnits','Hz',...
           'SamplesPerPeriod',[40 40 40],...
           'RampPeriods',[0 0 0],...
           'SettlingPeriods',[1 1 1]);
        plot(input)
  </code></pre>
  
  <p>Errors received from this are:</p>
  
  <pre><code>Error using frest.Sinestream/set.Frequency (line 127)
  The "Frequency" parameter of a sinestream signal should be a double vector consisting of unique values.
  
  Error in frest.Sinestream/initializeParams (line 508)
                  obj.(varargin{2*ct-1}) = varargin{2*ct};
  
  Error in frest.Sinestream (line 80)
              obj = initializeParams(obj,inputparams{:});
  
  Error in sine (line 1)
  input = frest.Sinestream('Frequency',[2 2 2],...
  </code></pre>