Prev: Triangulation with only a radius
Next: Reshape Error
From: Namo on 23 Mar 2010 05:15 Before I start , I will define some variables a is the initial value b is the final value i is the increment n is number of vales in the vector if we have a,b and i v=[a:i:b] if we have a,b and n v=linspace(a,b,n) if we have a , i and n , I use the equation n=(b-a)/i + 1 b = i*(n-1) + a then use any of the previous one Is there direct function if we have a,i,n?
From: Matt Fig on 23 Mar 2010 08:49 These can all be gotten with the colon operator, barring fp problems of course. a:inc:b % No number of elements a:(b-a)/(n-1):b % No increment a:inc:(a+inc*(n-1)) % No endpoint (b-inc*(n-1)):inc:b % No beginning point
From: Namo on 15 Apr 2010 11:47 "Matt Fig" <spamanon(a)yahoo.com> wrote in message <hoadci$m9r$1(a)fred.mathworks.com>... > These can all be gotten with the colon operator, barring fp problems of course. > > a:inc:b % No number of elements > a:(b-a)/(n-1):b % No increment > a:inc:(a+inc*(n-1)) % No endpoint > (b-inc*(n-1)):inc:b % No beginning point I see so there is no special function. we just need to rearrange the equation b = i*(n-1) + a for our need
|
Pages: 1 Prev: Triangulation with only a radius Next: Reshape Error |