Javier
Posts:
61
Registered:
4/26/11


Re: Access to float coordinates in a 3D matrix
Posted:
Dec 3, 2012 9:11 AM


"Nasser M. Abbasi" wrote in message <k9iaid$518$1@speranza.aioe.org>... > On 12/3/2012 7:31 AM, Javier wrote: > > >> you seem to be using the value itself as an index. > >> use the location of the value as index. Not the value itself. > >> > > > I use > > x = x0 + t*dx > > y = y0 + t*dy > > z = z0 + t*dz > > with t: 0:0.1:1, and d the direction vector. > > This is the value of the coordinate isn't it? > > > > when you say `This is the value of the coordinate isn't it`, > to which `This` are you refering to? > > any way, when you write > > t: 0:0.1:1; > x0=1; dx=0.1; > x = x0 + t*dx > > then use x(1) or x(5) to access values in the > x vector. do not use x(0.01) or x(0.5). > > You loop index will be something like > > for i=1:length(x) > x(i) = ..... > end > > Nasser > This are the first values for x: x(1),x(2) and x(3): 3,54551732809566 3,63234837121917 3,71917941434267 3.
They are floating points because I have a decimal resolution. If for example I want to acces Structures (x(1),y(1),z(1)), I can't.

