fork download
  1. N = 11;
  2. A = [1 4 7 4 3 6];
  3. B = interp1(linspace(0,1,numel(A)), A, linspace(0,1,N), 'nearest');
  4. disp(B)
  5.  
  6. % MATLAB output
  7. % >> B
  8. % B =
  9. % 1 4 4 4 7 4 4 4 3 6 6
  10. %
  11.  
Success #stdin #stdout 0.19s 65224KB
stdin
Standard input is empty
stdout
   1   4   4   4   7   4   4   3   3   6   6