Home > GLMdenoise > utilities > linspacefixeddiff.m

linspacefixeddiff

PURPOSE ^

function f = linspacefixeddiff(x,d,n)

SYNOPSIS ^

function f = linspacefixeddiff(x,d,n)

DESCRIPTION ^

 function f = linspacefixeddiff(x,d,n)

 <x> is a number
 <d> is difference between successive numbers
 <n> is the number of desired points (positive integer)

 return a vector of equally spaced values starting at <x>.

 example:
 isequal(linspacefixeddiff(0,2,5),[0 2 4 6 8])

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function f = linspacefixeddiff(x,d,n)
0002 
0003 % function f = linspacefixeddiff(x,d,n)
0004 %
0005 % <x> is a number
0006 % <d> is difference between successive numbers
0007 % <n> is the number of desired points (positive integer)
0008 %
0009 % return a vector of equally spaced values starting at <x>.
0010 %
0011 % example:
0012 % isequal(linspacefixeddiff(0,2,5),[0 2 4 6 8])
0013 
0014 x2 = x+d*(n-1);
0015 f = linspace(x,x2,n);

Generated on Fri 01-Aug-2014 12:03:17 by m2html © 2005